mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
set energy entities to HA-category diagnostic (metioned on discord)
This commit is contained in:
@@ -881,7 +881,6 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
|||||||
break;
|
break;
|
||||||
case DeviceValueType::STRING:
|
case DeviceValueType::STRING:
|
||||||
snprintf(topic, sizeof(topic), "text/%s", config_topic); // e.g. set_datetime, set_holiday, set_wwswitchtime
|
snprintf(topic, sizeof(topic), "text/%s", config_topic); // e.g. set_datetime, set_holiday, set_wwswitchtime
|
||||||
set_ha_classes = true;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// plain old sensor
|
// plain old sensor
|
||||||
@@ -1130,7 +1129,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
|||||||
|
|
||||||
// add category "diagnostic" for system entities
|
// add category "diagnostic" for system entities
|
||||||
// config for writeable entities, like switches. diagnostic for read only sensors.
|
// config for writeable entities, like switches. diagnostic for read only sensors.
|
||||||
doc["ent_cat"] = (has_cmd) ? "config" : "diagnostic";
|
doc["ent_cat"] = (has_cmd && !set_ha_classes) ? "config" : "diagnostic";
|
||||||
|
|
||||||
// add the dev json object to the end
|
// add the dev json object to the end
|
||||||
doc["dev"] = dev_json;
|
doc["dev"] = dev_json;
|
||||||
|
|||||||
Reference in New Issue
Block a user