mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
energy values as HA sensors with classes, v3.6.1-dev0e
This commit is contained in:
@@ -847,7 +847,7 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
|||||||
case DeviceValueType::UINT:
|
case DeviceValueType::UINT:
|
||||||
case DeviceValueType::SHORT:
|
case DeviceValueType::SHORT:
|
||||||
case DeviceValueType::USHORT:
|
case DeviceValueType::USHORT:
|
||||||
case DeviceValueType::ULONG:
|
// case DeviceValueType::ULONG:
|
||||||
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
if (discovery_type() == discoveryType::HOMEASSISTANT) {
|
||||||
// Home Assistant
|
// Home Assistant
|
||||||
// number - https://www.home-assistant.io/integrations/number.mqtt
|
// number - https://www.home-assistant.io/integrations/number.mqtt
|
||||||
@@ -866,6 +866,10 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
|
|||||||
// select - https://www.home-assistant.io/integrations/select.mqtt
|
// select - https://www.home-assistant.io/integrations/select.mqtt
|
||||||
snprintf(topic, sizeof(topic), "select/%s", config_topic);
|
snprintf(topic, sizeof(topic), "select/%s", config_topic);
|
||||||
break;
|
break;
|
||||||
|
case DeviceValueType::ULONG:
|
||||||
|
snprintf(topic, sizeof(topic), "sensor/%s", config_topic);
|
||||||
|
set_ha_classes = true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// plain old sensor
|
// plain old sensor
|
||||||
snprintf(topic, sizeof(topic), "sensor/%s", config_topic);
|
snprintf(topic, sizeof(topic), "sensor/%s", config_topic);
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define EMSESP_APP_VERSION "3.6.1-dev.0d"
|
#define EMSESP_APP_VERSION "3.6.1-dev.0e"
|
||||||
|
|||||||
Reference in New Issue
Block a user