Skip to content

Commit 803b935

Browse files
authored
Merge pull request #34 from aubierr/main
Add support HA 2025.1
2 parents fa130b4 + 2e81a77 commit 803b935

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

custom_components/keyatome/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"iot_class": "cloud_polling",
88
"issue_tracker": "https://github.com/jugla/keyatome/issues",
99
"requirements": ["pykeyatome==2.1.2"],
10-
"version" : "7.4.2"
10+
"version" : "7.4.3"
1111
}

custom_components/keyatome/sensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
SensorEntity,
1111
SensorStateClass,
1212
)
13+
from homeassistant.const import UnitOfEnergy, UnitOfPower
1314
from homeassistant.const import (
1415
ATTR_ATTRIBUTION,
1516
CONF_NAME,
1617
CONF_PASSWORD,
1718
CONF_USERNAME,
18-
ENERGY_KILO_WATT_HOUR,
19-
POWER_WATT,
2019
STATE_UNAVAILABLE,
2120
STATE_UNKNOWN,
2221
)
22+
2323
from homeassistant.core import callback
2424
from homeassistant.helpers.device_registry import DeviceEntryType
2525
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
@@ -986,7 +986,7 @@ def __init__(
986986

987987
# HA attributes
988988
self._attr_device_class = SensorDeviceClass.POWER
989-
self._attr_native_unit_of_measurement = POWER_WATT
989+
self._attr_native_unit_of_measurement = UnitOfPower.WATT
990990
self._attr_state_class = SensorStateClass.MEASUREMENT
991991

992992
@property
@@ -1037,7 +1037,7 @@ def __init__(
10371037

10381038
# HA attributes
10391039
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
10411041
self._attr_state_class = SensorStateClass.TOTAL_INCREASING
10421042

10431043
async def async_added_to_hass(self):

0 commit comments

Comments
 (0)