This commit is contained in:
proddy
2024-11-07 15:41:02 +01:00
parent 77330c99f4
commit cce5c0d09e

View File

@@ -1140,9 +1140,12 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
} else if (uom == DeviceValueUOM::SECONDS) {
doc[uom_ha] = "s";
} else if (uom != DeviceValueUOM::NONE) {
// Domoticz use "" for a no-uom
if (discovery_type() == discoveryType::HOMEASSISTANT) {
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
}
}
}
// set state and device class
// also icon, when there is no device class that sets one