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 Franck Nijhof
parent 683069cb98
commit b63bc72450
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

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: