Skip to content

Commit 85d09ae

Browse files
authored
Merge pull request #7 from ChristophCaina/patch-1
fix depricated ENERGY_KILO_WATT_HOUR
2 parents 18a556d + 2cd1bee commit 85d09ae

File tree

1 file changed

+5
-5
lines changed
  • custom_components/solaredge_forecast

1 file changed

+5
-5
lines changed

custom_components/solaredge_forecast/const.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SensorStateClass,
1010
)
1111
from homeassistant.const import (
12-
ENERGY_KILO_WATT_HOUR
12+
UnitOfEnergy
1313
)
1414

1515
DOMAIN = "solaredge_forecast"
@@ -56,31 +56,31 @@ class SolaredgeForecastSensorEntityDescription(SensorEntityDescription):
5656
key="solaredge_forecast",
5757
name="Solar energy forecast",
5858
icon="mdi:solar-power",
59-
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
59+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
6060
device_class=SensorDeviceClass.ENERGY,
6161
state_class=SensorStateClass.TOTAL,
6262
),
6363
SolaredgeForecastSensorEntityDescription(
6464
key="solaredge_produced",
6565
name="Solar energy produced",
6666
icon="mdi:solar-power",
67-
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
67+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
6868
device_class=SensorDeviceClass.ENERGY,
6969
state_class=SensorStateClass.TOTAL,
7070
),
7171
SolaredgeForecastSensorEntityDescription(
7272
key="solaredge_estimated",
7373
name="Solar energy expected",
7474
icon="mdi:solar-power",
75-
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
75+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
7676
device_class=SensorDeviceClass.ENERGY,
7777
state_class=SensorStateClass.TOTAL,
7878
),
7979
SolaredgeForecastSensorEntityDescription(
8080
key="solaredge_progress",
8181
name="Solar energy progress",
8282
icon="mdi:solar-power",
83-
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
83+
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
8484
device_class=SensorDeviceClass.ENERGY,
8585
state_class=SensorStateClass.TOTAL,
8686
),

0 commit comments

Comments
 (0)