mirror of
https://github.com/home-assistant/core.git
synced 2025-08-09 23:55:07 +02:00
Move DEVICE_TRACKERS a little higher in the file
This commit is contained in:
@@ -41,6 +41,17 @@ class StarlinkDeviceTrackerEntityDescription(
|
|||||||
"""Describes a Starlink button entity."""
|
"""Describes a Starlink button entity."""
|
||||||
|
|
||||||
|
|
||||||
|
DEVICE_TRACKERS = [
|
||||||
|
StarlinkDeviceTrackerEntityDescription(
|
||||||
|
key="device_location",
|
||||||
|
translation_key="device_location",
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
latitude_fn=lambda data: data.location["latitude"],
|
||||||
|
longitude_fn=lambda data: data.location["longitude"],
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
class StarlinkDeviceTrackerEntity(StarlinkEntity, TrackerEntity):
|
class StarlinkDeviceTrackerEntity(StarlinkEntity, TrackerEntity):
|
||||||
"""A TrackerEntity for Starlink devices. Handles creating unique IDs."""
|
"""A TrackerEntity for Starlink devices. Handles creating unique IDs."""
|
||||||
|
|
||||||
@@ -60,14 +71,3 @@ class StarlinkDeviceTrackerEntity(StarlinkEntity, TrackerEntity):
|
|||||||
def longitude(self) -> float | None:
|
def longitude(self) -> float | None:
|
||||||
"""Return longitude value of the device."""
|
"""Return longitude value of the device."""
|
||||||
return self.entity_description.longitude_fn(self.coordinator.data)
|
return self.entity_description.longitude_fn(self.coordinator.data)
|
||||||
|
|
||||||
|
|
||||||
DEVICE_TRACKERS = [
|
|
||||||
StarlinkDeviceTrackerEntityDescription(
|
|
||||||
key="device_location",
|
|
||||||
translation_key="device_location",
|
|
||||||
entity_registry_enabled_default=False,
|
|
||||||
latitude_fn=lambda data: data.location["latitude"],
|
|
||||||
longitude_fn=lambda data: data.location["longitude"],
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
Reference in New Issue
Block a user