Code for fixing energy sensor warning
StefanoGiu opened this issue · 1 comments
StefanoGiu commented
You should fix the code this way:
if sensor.native_unit_of_measurement:
self._attr_native_unit_of_measurement = sensor.native_unit_of_measurement
if sensor.native_unit_of_measurement and sensor.device_class!=SensorDeviceClass.ENERGY:
self._attr_state_class = SensorStateClass.MEASUREMENT
Moreover, I don't get the updates of this custom component via Hacs... why?
ColinRobbins commented
Is this a fix for #233 ?