Skip to content

Commit fe293ea

Browse files
Tim EmpringhamTim Empringham
authored andcommitted
Update constants for units of measure to match updates in Home Assistant core.
1 parent 0be06f6 commit fe293ea

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

custom_components/satellitetracker/device_tracker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from homeassistant.components.device_tracker.config_entry import TrackerEntity
44
from homeassistant.components.device_tracker.const import DOMAIN as DEVICE_TRACKER
5-
from homeassistant.components.device_tracker.const import SOURCE_TYPE_GPS
5+
from homeassistant.components.device_tracker.const import SourceType
66
from homeassistant.const import ATTR_NAME
77
from homeassistant.helpers.update_coordinator import CoordinatorEntity
88

@@ -63,7 +63,7 @@ def longitude(self):
6363
@property
6464
def source_type(self):
6565
"""Return the source type of the client."""
66-
return SOURCE_TYPE_GPS
66+
return SourceType.GPS
6767

6868
@property
6969
def device_info(self):

custom_components/satellitetracker/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from homeassistant.util.dt import as_local, utc_from_timestamp
88
from homeassistant.components.sensor import ENTITY_ID_FORMAT
9-
from homeassistant.const import TIME_SECONDS, ATTR_NAME
9+
from homeassistant.const import UnitOfTime, ATTR_NAME
1010
from homeassistant.helpers.entity import Entity
1111
from homeassistant.helpers.update_coordinator import (
1212
CoordinatorEntity,
@@ -97,7 +97,7 @@ def available(self) -> bool:
9797
@property
9898
def unit_of_measurement(self):
9999
"""Return the UoM for this entity."""
100-
return TIME_SECONDS
100+
return UnitOfTime.SECONDS
101101

102102
@property
103103
def state(self):

0 commit comments

Comments
 (0)