mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
Remove double publish_state in ultrasonic sensor (#696)
Fixes https://github.com/esphome/issues/issues/589
This commit is contained in:
@@ -26,7 +26,6 @@ void UltrasonicSensorComponent::update() {
|
|||||||
this->publish_state(NAN);
|
this->publish_state(NAN);
|
||||||
} else {
|
} else {
|
||||||
float result = UltrasonicSensorComponent::us_to_m(time);
|
float result = UltrasonicSensorComponent::us_to_m(time);
|
||||||
this->publish_state(result);
|
|
||||||
ESP_LOGD(TAG, "'%s' - Got distance: %.2f m", this->name_.c_str(), result);
|
ESP_LOGD(TAG, "'%s' - Got distance: %.2f m", this->name_.c_str(), result);
|
||||||
this->publish_state(result);
|
this->publish_state(result);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user