mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-24 11:39:53 +00:00
This commit is contained in:
@@ -752,9 +752,9 @@ export default class HomeAssistant extends Extension {
|
||||
},
|
||||
};
|
||||
|
||||
// When state_class == measurement, unit_of_measurement must be set, otherwise warnings are generated.
|
||||
// When a device_class is set, unit_of_measurement must be set, otherwise warnings are generated.
|
||||
// https://github.com/Koenkk/zigbee2mqtt/issues/15958#issuecomment-1377483202
|
||||
if (discoveryEntry.discovery_payload.state_class === 'measurement' &&
|
||||
if (discoveryEntry.discovery_payload.device_class &&
|
||||
!discoveryEntry.discovery_payload.unit_of_measurement) {
|
||||
delete discoveryEntry.discovery_payload.state_class;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user