File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
custom_components/keyatome Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 7
7
"iot_class" : " cloud_polling" ,
8
8
"issue_tracker" : " https://github.com/jugla/keyatome/issues" ,
9
9
"requirements" : [" pykeyatome==2.1.2" ],
10
- "version" : " 7.4.2 "
10
+ "version" : " 7.4.3 "
11
11
}
Original file line number Diff line number Diff line change 10
10
SensorEntity ,
11
11
SensorStateClass ,
12
12
)
13
+ from homeassistant .const import UnitOfEnergy , UnitOfPower
13
14
from homeassistant .const import (
14
15
ATTR_ATTRIBUTION ,
15
16
CONF_NAME ,
16
17
CONF_PASSWORD ,
17
18
CONF_USERNAME ,
18
- ENERGY_KILO_WATT_HOUR ,
19
- POWER_WATT ,
20
19
STATE_UNAVAILABLE ,
21
20
STATE_UNKNOWN ,
22
21
)
22
+
23
23
from homeassistant .core import callback
24
24
from homeassistant .helpers .device_registry import DeviceEntryType
25
25
from homeassistant .helpers .entity import DeviceInfo , EntityCategory
@@ -986,7 +986,7 @@ def __init__(
986
986
987
987
# HA attributes
988
988
self ._attr_device_class = SensorDeviceClass .POWER
989
- self ._attr_native_unit_of_measurement = POWER_WATT
989
+ self ._attr_native_unit_of_measurement = UnitOfPower . WATT
990
990
self ._attr_state_class = SensorStateClass .MEASUREMENT
991
991
992
992
@property
@@ -1037,7 +1037,7 @@ def __init__(
1037
1037
1038
1038
# HA attributes
1039
1039
self ._attr_device_class = SensorDeviceClass .ENERGY
1040
- self ._attr_native_unit_of_measurement = ENERGY_KILO_WATT_HOUR
1040
+ self ._attr_native_unit_of_measurement = UnitOfEnergy . KILO_WATT_HOUR
1041
1041
self ._attr_state_class = SensorStateClass .TOTAL_INCREASING
1042
1042
1043
1043
async def async_added_to_hass (self ):
You can’t perform that action at this time.
0 commit comments