mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
use default icondegrees in HA
This commit is contained in:
@@ -66,7 +66,7 @@ std::string Mqtt::lastresponse_ = "";
|
|||||||
// icons from https://materialdesignicons.com used with the UOMs (unit of measurements)
|
// icons from https://materialdesignicons.com used with the UOMs (unit of measurements)
|
||||||
MAKE_WORD(measurement)
|
MAKE_WORD(measurement)
|
||||||
MAKE_WORD(total_increasing)
|
MAKE_WORD(total_increasing)
|
||||||
MAKE_WORD_CUSTOM(icondegrees, "mdi:coolant-temperature") // DeviceValueUOM::DEGREES
|
// MAKE_WORD_CUSTOM(icondegrees, "mdi:coolant-temperature") // DeviceValueUOM::DEGREES
|
||||||
MAKE_WORD_CUSTOM(iconpercent, "mdi:percent-outline") // DeviceValueUOM::PERCENT
|
MAKE_WORD_CUSTOM(iconpercent, "mdi:percent-outline") // DeviceValueUOM::PERCENT
|
||||||
MAKE_WORD_CUSTOM(iconkb, "mdi:memory") // DeviceValueUOM::KB
|
MAKE_WORD_CUSTOM(iconkb, "mdi:memory") // DeviceValueUOM::KB
|
||||||
MAKE_WORD_CUSTOM(iconlmin, "mdi:water-boiler") // DeviceValueUOM::LMIN
|
MAKE_WORD_CUSTOM(iconlmin, "mdi:water-boiler") // DeviceValueUOM::LMIN
|
||||||
@@ -1149,8 +1149,6 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
|
|||||||
case DeviceValueUOM::K:
|
case DeviceValueUOM::K:
|
||||||
doc[sc_ha] = F_(measurement);
|
doc[sc_ha] = F_(measurement);
|
||||||
doc[dc_ha] = "temperature";
|
doc[dc_ha] = "temperature";
|
||||||
if (is_discovery)
|
|
||||||
doc["ic"] = F_(icondegrees); // icon // TODO check if still needed
|
|
||||||
// override uom if fahrenheit
|
// override uom if fahrenheit
|
||||||
doc[uom_ha] = EMSESP::system_.fahrenheit() ? DeviceValue::DeviceValueUOM_s[DeviceValueUOM::FAHRENHEIT] : DeviceValue::DeviceValueUOM_s[uom];
|
doc[uom_ha] = EMSESP::system_.fahrenheit() ? DeviceValue::DeviceValueUOM_s[DeviceValueUOM::FAHRENHEIT] : DeviceValue::DeviceValueUOM_s[uom];
|
||||||
break;
|
break;
|
||||||
@@ -1158,7 +1156,7 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
|
|||||||
doc[sc_ha] = F_(measurement);
|
doc[sc_ha] = F_(measurement);
|
||||||
doc[dc_ha] = "power_factor";
|
doc[dc_ha] = "power_factor";
|
||||||
if (is_discovery)
|
if (is_discovery)
|
||||||
doc["ic"] = F_(iconpercent); // icon // TODO check if still needed
|
doc["ic"] = F_(iconpercent); // icon
|
||||||
break;
|
break;
|
||||||
case DeviceValueUOM::SECONDS:
|
case DeviceValueUOM::SECONDS:
|
||||||
case DeviceValueUOM::MINUTES:
|
case DeviceValueUOM::MINUTES:
|
||||||
|
|||||||
Reference in New Issue
Block a user