mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix publish_ha_config, and add clear
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -300,6 +300,8 @@ class EMSdevice {
|
||||
ha_config_done_ = v;
|
||||
}
|
||||
|
||||
void ha_config_clear();
|
||||
|
||||
enum Brand : uint8_t {
|
||||
NO_BRAND = 0, // 0
|
||||
BOSCH, // 1
|
||||
|
||||
@@ -423,7 +423,7 @@ void EMSESP::reset_mqtt_ha() {
|
||||
}
|
||||
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
emsdevice->ha_config_done(false);
|
||||
emsdevice->ha_config_clear();
|
||||
}
|
||||
dallassensor_.reload();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user