Skip to content

Commit

Permalink
Use newer enum values in preparation for 2025.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twhittock committed Mar 30, 2024
1 parent 6563e0b commit a0b3fab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/eo_mini/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SensorStateClass,
SensorDeviceClass,
)
from homeassistant.const import TIME_SECONDS, ENERGY_WATT_HOUR
from homeassistant.const import UnitOfTime, UnitOfEnergy
from homeassistant.core import callback

from custom_components.eo_mini import EODataUpdateCoordinator
Expand Down Expand Up @@ -36,7 +36,7 @@ class EOMiniChargerSessionEnergySensor(EOMiniChargerEntity, SensorEntity):
def __init__(self, *args):
self.entity_description = SensorEntityDescription(
key=SensorDeviceClass.ENERGY,
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
name="Consumption",
Expand Down Expand Up @@ -73,7 +73,7 @@ class EOMiniChargerSessionChargingTimeSensor(EOMiniChargerEntity, SensorEntity):
def __init__(self, *args):
self.entity_description = SensorEntityDescription(
key=SensorDeviceClass.DURATION,
native_unit_of_measurement=TIME_SECONDS,
native_unit_of_measurement=UnitOfTime.SECONDS,
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.TOTAL_INCREASING,
name="Charging Time",
Expand Down

0 comments on commit a0b3fab

Please sign in to comment.