Skip to content

Commit

Permalink
Merge pull request #10 from danielsmith-eu/bugfix/time_minutes_deprec…
Browse files Browse the repository at this point in the history
…ated

Update sensor.py
  • Loading branch information
danielsmith-eu authored Mar 15, 2024
2 parents bb18cb1 + e017a48 commit 5a7414d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/themeparks/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TIME_MINUTES
from homeassistant.const import UnitOfTime
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import (
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(self, coordinator, idx):
super().__init__(coordinator)
self.idx = idx
self._attr_name = coordinator.data[idx][NAME]
self._attr_native_unit_of_measurement = TIME_MINUTES
self._attr_native_unit_of_measurement = UnitOfTime.TIME_MINUTES
self._attr_device_class = SensorDeviceClass.DURATION
self._attr_state_class = SensorStateClass.MEASUREMENT
self._attr_native_value = self.coordinator.data[self.idx][TIME]
Expand Down

0 comments on commit 5a7414d

Please sign in to comment.