Skip to content

Commit

Permalink
domoticz use "" for no-uom (#2177 (comment))
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Nov 7, 2024
1 parent 77330c9 commit cce5c0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,10 @@ 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) {
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
// Domoticz use "" for a no-uom
if (discovery_type() == discoveryType::HOMEASSISTANT) {
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
}
}
}

Expand Down

0 comments on commit cce5c0d

Please sign in to comment.