DHT publish NAN on invalid reading

Fixes https://github.com/esphome/issues/issues/590
This commit is contained in:
Otto Winter 2019-08-31 21:14:10 +02:00
parent 4b0f203049
commit c2028f7378
No known key found for this signature in database
GPG key ID: DB66C0BE6013F97E

View file

@ -56,6 +56,8 @@ void DHT::update() {
str = " and consider manually specifying the DHT model using the model option"; str = " and consider manually specifying the DHT model using the model option";
} }
ESP_LOGW(TAG, "Invalid readings! Please check your wiring (pull-up resistor, pin number)%s.", str); ESP_LOGW(TAG, "Invalid readings! Please check your wiring (pull-up resistor, pin number)%s.", str);
this->temperature_sensor_->publish_state(NAN);
this->humidity_sensor_->publish_state(NAN);
this->status_set_warning(); this->status_set_warning();
} }
} }