mitch-dc / volkswagen_we_connect_id

Apache License 2.0
195 stars 51 forks source link

Code for fixing energy sensor warning #255

Open StefanoGiu opened 5 months ago

StefanoGiu commented 5 months ago

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 1 month ago

Is this a fix for https://github.com/mitch-dc/volkswagen_we_connect_id/issues/233 ?