fix publish_ha_config, and add clear

This commit is contained in:
MichaelDvP
2021-04-10 13:32:09 +02:00
parent 4cac16093f
commit 015ab649af
3 changed files with 14 additions and 3 deletions

View File

@@ -770,8 +770,17 @@ void EMSdevice::publish_mqtt_ha_sensor() {
dv.ha |= DeviceValueHA::HA_DONE;
}
}
// bool ok = publish_ha_config();
// ha_config_done(ok); // see if it worked
if (!ha_config_done()) {
bool ok = publish_ha_config();
ha_config_done(ok); // see if it worked
}
}
void EMSdevice::ha_config_clear() {
for (auto & dv : devicevalues_) {
dv.ha &= ~DeviceValueHA::HA_DONE;
}
ha_config_done(false);
}
// return the name of the telegram type