Add missing device class to SAJ energy sensors (#54048)
This commit is contained in:
parent
29e604bd22
commit
1bc3c743db
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||
CONF_PASSWORD,
|
||||
CONF_TYPE,
|
||||
CONF_USERNAME,
|
||||
DEVICE_CLASS_ENERGY,
|
||||
DEVICE_CLASS_POWER,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
|
@ -204,6 +205,8 @@ class SAJsensor(SensorEntity):
|
|||
"""Return the device class the sensor belongs to."""
|
||||
if self.unit_of_measurement == POWER_WATT:
|
||||
return DEVICE_CLASS_POWER
|
||||
if self.unit_of_measurement == ENERGY_KILO_WATT_HOUR:
|
||||
return DEVICE_CLASS_ENERGY
|
||||
if (
|
||||
self.unit_of_measurement == TEMP_CELSIUS
|
||||
or self._sensor.unit == TEMP_FAHRENHEIT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue