mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
make 'eco+ switch_off' enity unique in v.3.4 format
HA ignores characters '+' in uniq_id/obj_id, so to make the entity 'eco+ switch_off' different from 'eco switch_off', it will be renamed to 'eco2 switch_off'.
This commit is contained in:
@@ -1010,6 +1010,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
||||
char uniq_s[60];
|
||||
strlcpy(uniq_s, en_name, sizeof(uniq_s));
|
||||
Helpers::replace_char(uniq_s, ' ', '_');
|
||||
Helpers::replace_char(uniq_s, '+', '2'); //changes 'eco+_switch_off' to 'eco2_switch_off' (HA ignores '+')
|
||||
if (has_tag) {
|
||||
snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", device_name, DeviceValue::DeviceValueTAG_s[tag][0], Helpers::toLower(uniq_s).c_str());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user