mirror of
https://github.com/home-assistant/core
synced 2024-09-09 12:51:22 +02:00
Add missing device class to SAJ energy sensors (#54048)
This commit is contained in:
parent
29e604bd22
commit
1bc3c743db
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||||||
CONF_PASSWORD,
|
CONF_PASSWORD,
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
CONF_USERNAME,
|
CONF_USERNAME,
|
||||||
|
DEVICE_CLASS_ENERGY,
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_POWER,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
ENERGY_KILO_WATT_HOUR,
|
ENERGY_KILO_WATT_HOUR,
|
||||||
@ -204,6 +205,8 @@ class SAJsensor(SensorEntity):
|
|||||||
"""Return the device class the sensor belongs to."""
|
"""Return the device class the sensor belongs to."""
|
||||||
if self.unit_of_measurement == POWER_WATT:
|
if self.unit_of_measurement == POWER_WATT:
|
||||||
return DEVICE_CLASS_POWER
|
return DEVICE_CLASS_POWER
|
||||||
|
if self.unit_of_measurement == ENERGY_KILO_WATT_HOUR:
|
||||||
|
return DEVICE_CLASS_ENERGY
|
||||||
if (
|
if (
|
||||||
self.unit_of_measurement == TEMP_CELSIUS
|
self.unit_of_measurement == TEMP_CELSIUS
|
||||||
or self._sensor.unit == TEMP_FAHRENHEIT
|
or self._sensor.unit == TEMP_FAHRENHEIT
|
||||||
|
Loading…
Reference in New Issue
Block a user