mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
add stat_cla to temperaturesensor #1713
This commit is contained in:
@@ -499,8 +499,9 @@ void TemperatureSensor::publish_values(const bool force) {
|
|||||||
} else if (!sensor.ha_registered || force) {
|
} else if (!sensor.ha_registered || force) {
|
||||||
LOG_DEBUG("Recreating HA config for sensor ID %s", sensor.id().c_str());
|
LOG_DEBUG("Recreating HA config for sensor ID %s", sensor.id().c_str());
|
||||||
|
|
||||||
JsonDocument config; // this needs to be large because of all the copying in add_ha_sections_to_doc()
|
JsonDocument config;
|
||||||
config["dev_cla"] = "temperature";
|
config["dev_cla"] = "temperature";
|
||||||
|
config["stat_cla"] = "measurement";
|
||||||
|
|
||||||
char stat_t[50];
|
char stat_t[50];
|
||||||
snprintf(stat_t, sizeof(stat_t), "%s/%s_data", Mqtt::base().c_str(), F_(temperaturesensor)); // use base path
|
snprintf(stat_t, sizeof(stat_t), "%s/%s_data", Mqtt::base().c_str(), F_(temperaturesensor)); // use base path
|
||||||
|
|||||||
Reference in New Issue
Block a user