Use shorthand attributes in tesla_fleet device tracker (#126736)

This commit is contained in:
epenet 2024-09-25 14:21:36 +02:00 committed by GitHub
parent a1906b434f
commit 10b9e3b29c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,9 +32,6 @@ class TeslaFleetDeviceTrackerEntity(
):
"""Base class for Tesla Fleet device tracker entities."""
_attr_latitude: float | None = None
_attr_longitude: float | None = None
def __init__(
self,
vehicle: TeslaFleetVehicleData,
@ -53,16 +50,6 @@ class TeslaFleetDeviceTrackerEntity(
self._attr_latitude = state.attributes.get("latitude")
self._attr_longitude = state.attributes.get("longitude")
@property
def latitude(self) -> float | None:
"""Return latitude value of the device."""
return self._attr_latitude
@property
def longitude(self) -> float | None:
"""Return longitude value of the device."""
return self._attr_longitude
class TeslaFleetDeviceTrackerLocationEntity(TeslaFleetDeviceTrackerEntity):
"""Vehicle Location device tracker Class."""