1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 00:05:43 +00:00

Add sensor force_update option (#783)

* Add sensor force_update option

* Add test
This commit is contained in:
Otto Winter
2019-10-21 15:46:39 +02:00
committed by GitHub
parent d64a4ef2b4
commit ae8700447e
8 changed files with 34 additions and 4 deletions

View File

@@ -55,6 +55,9 @@ void MQTTSensorComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryCo
if (!this->sensor_->get_icon().empty())
root["icon"] = this->sensor_->get_icon();
if (this->sensor_->get_force_update())
root["force_update"] = true;
config.command_topic = false;
}
bool MQTTSensorComponent::send_initial_state() {