mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
mqtt-HA-config dynamically
This commit is contained in:
@@ -440,8 +440,8 @@ void EMSESP::publish_device_values(uint8_t device_type) {
|
||||
// group by device type
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_type)) {
|
||||
// if we're using HA and it's not already done, send the config topics first. only do this once
|
||||
if (Mqtt::ha_enabled() && (!emsdevice->ha_config_done())) {
|
||||
// if we're using HA, if done is checked for each sensor in devices
|
||||
if (Mqtt::ha_enabled()) {
|
||||
emsdevice->publish_mqtt_ha_sensor(); // create the configs for each value as a sensor
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user