Fix device class on sensor in ViCare (#122334)

update device class on init
This commit is contained in:
Christopher Fenner 2024-07-23 21:56:46 +02:00 committed by GitHub
parent fd6f1cfbdc
commit f135d3d16c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -950,6 +950,8 @@ class ViCareSensor(ViCareEntity, SensorEntity):
"""Initialize the sensor."""
super().__init__(device_config, api, description.key)
self.entity_description = description
# run update to have device_class set depending on unit_of_measurement
self.update()
@property
def available(self) -> bool: