diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 61806f40f..f02869226 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -15,6 +15,7 @@ This release is based on the latest Espressif/Arduino core version 3. It brings - added eth_10mbit to Network Settings, which forces 10BASE-T half-duplex & autonegotiation off, halving the PHY’s power draw. It’s off by default as it will cause issues on managed switches with a port forced to 100Mb [#3213](https://github.com/emsesp/EMS-ESP32/pull/3213) - cleaner MD5 and firmware uploading in WebUI [#3222](https://github.com/emsesp/EMS-ESP32/issues/3222) - pc0Flow in l/min [#3224](https://github.com/emsesp/EMS-ESP32/issues/3224) +- remove HA config for excluded entities [#3229](https://github.com/emsesp/EMS-ESP32/issues/3229) ## Fixed diff --git a/src/core/emsdevice.cpp b/src/core/emsdevice.cpp index 5fa829408..43d9a4ed3 100644 --- a/src/core/emsdevice.cpp +++ b/src/core/emsdevice.cpp @@ -2173,6 +2173,13 @@ void EMSdevice::mqtt_ha_entity_config_create() { } } + if (dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE) && dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED)) { + // remove HA config for excluded entities + if (Mqtt::publish_ha_sensor_config_dv(dv, name().c_str(), brand_to_cstr(), to_string_version().c_str(), true, false)) { + dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); + } + } + if (!dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) && dv.has_state(DeviceValueState::DV_ACTIVE) && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE)) { // create_device_config is only done once for the EMS device. It can added to any entity, so we take the first diff --git a/src/emsesp_version.h b/src/emsesp_version.h index be3d8d15d..4750696f3 100644 --- a/src/emsesp_version.h +++ b/src/emsesp_version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.9.0-dev.8" +#define EMSESP_APP_VERSION "3.9.0-dev.9"