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?
You should fix the code this way:
Moreover, I don't get the updates of this custom component via Hacs... why?