use total for energyLastHour instead

This commit is contained in:
proddy
2024-06-12 10:22:11 +02:00
parent dcb83989c8
commit b92607f0e9

View File

@@ -1177,8 +1177,10 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
break;
case DeviceValueUOM::WH:
// https://github.com/emsesp/EMS-ESP32/issues/1796
if ((entity == FL_(energyToday)[0]) || entity == FL_(energyLastHour)[0]) {
if (entity == FL_(energyToday)[0]) {
doc[sc_ha] = F_(total_increasing);
} else if (entity == FL_(energyLastHour)[0]) {
doc[sc_ha] = "total";
} else {
doc[sc_ha] = F_(measurement);
}