mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 16:49:11 +03:00
fixes #2862
This commit is contained in:
@@ -1144,7 +1144,7 @@ void Mqtt::add_ha_classes(JsonObject doc, const uint8_t device_type, const uint8
|
|||||||
const char * sc_ha_total = "total";
|
const char * sc_ha_total = "total";
|
||||||
const char * sc_ha_total_increasing = "total_increasing";
|
const char * sc_ha_total_increasing = "total_increasing";
|
||||||
|
|
||||||
// set uom, unless boolean - as HA is fussy with the naming
|
// set uom, unless boolean - as HA is fussy with the naming and is case sensitive
|
||||||
// map too HA uom specific codes from https://github.com/home-assistant/core/blob/dev/homeassistant/const.py
|
// map too HA uom specific codes from https://github.com/home-assistant/core/blob/dev/homeassistant/const.py
|
||||||
if (type != DeviceValueType::BOOL) {
|
if (type != DeviceValueType::BOOL) {
|
||||||
if (uom == DeviceValueUOM::HOURS) {
|
if (uom == DeviceValueUOM::HOURS) {
|
||||||
@@ -1157,6 +1157,8 @@ void Mqtt::add_ha_classes(JsonObject doc, const uint8_t device_type, const uint8
|
|||||||
doc[uom_ha] = "kB";
|
doc[uom_ha] = "kB";
|
||||||
} else if (uom == DeviceValueUOM::LMIN) {
|
} else if (uom == DeviceValueUOM::LMIN) {
|
||||||
doc[uom_ha] = "L/min";
|
doc[uom_ha] = "L/min";
|
||||||
|
} else if (uom == DeviceValueUOM::LH) {
|
||||||
|
doc[uom_ha] = "L/h";
|
||||||
} else if (uom != DeviceValueUOM::NONE) {
|
} else if (uom != DeviceValueUOM::NONE) {
|
||||||
doc[uom_ha] = EMSdevice::uom_to_string(uom); // use default
|
doc[uom_ha] = EMSdevice::uom_to_string(uom); // use default
|
||||||
} else if (discovery_type() != discoveryType::HOMEASSISTANT) {
|
} else if (discovery_type() != discoveryType::HOMEASSISTANT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user