Skip to content

Commit cce5c0d

Browse files
committed
domoticz use "" for no-uom (#2177 (comment))
1 parent 77330c9 commit cce5c0d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/mqtt.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,10 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
11401140
} else if (uom == DeviceValueUOM::SECONDS) {
11411141
doc[uom_ha] = "s";
11421142
} else if (uom != DeviceValueUOM::NONE) {
1143-
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
1143+
// Domoticz use "" for a no-uom
1144+
if (discovery_type() == discoveryType::HOMEASSISTANT) {
1145+
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
1146+
}
11441147
}
11451148
}
11461149

0 commit comments

Comments
 (0)