Hardcode GPS source type

This commit is contained in:
Jack Boswell (boswelja)
2023-08-07 20:10:42 +12:00
parent 30691b5433
commit e3c8f77115

View File

@@ -30,7 +30,6 @@ async def async_setup_entry(
class StarlinkDeviceTrackerEntityDescriptionMixin: class StarlinkDeviceTrackerEntityDescriptionMixin:
"""Describes a Starlink device tracker.""" """Describes a Starlink device tracker."""
source_type: SourceType
latitude_fn: Callable[[StarlinkData], float] latitude_fn: Callable[[StarlinkData], float]
longitude_fn: Callable[[StarlinkData], float] longitude_fn: Callable[[StarlinkData], float]
@@ -50,7 +49,7 @@ class StarlinkDeviceTrackerEntity(StarlinkEntity, TrackerEntity):
@property @property
def source_type(self) -> SourceType | str: def source_type(self) -> SourceType | str:
"""Return the source type, eg gps or router, of the device.""" """Return the source type, eg gps or router, of the device."""
return self.entity_description.source_type return SourceType.GPS
@property @property
def latitude(self) -> float | None: def latitude(self) -> float | None:
@@ -68,7 +67,6 @@ DEVICE_TRACKERS = [
key="device_location", key="device_location",
name="Device location", name="Device location",
entity_registry_enabled_default=False, entity_registry_enabled_default=False,
source_type=SourceType.GPS,
latitude_fn=lambda data: data.location["latitude"], latitude_fn=lambda data: data.location["latitude"],
longitude_fn=lambda data: data.location["longitude"], longitude_fn=lambda data: data.location["longitude"],
), ),