mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use shorthand attributes in tesla_fleet device tracker (#126736)
This commit is contained in:
parent
a1906b434f
commit
10b9e3b29c
@ -32,9 +32,6 @@ class TeslaFleetDeviceTrackerEntity(
|
|||||||
):
|
):
|
||||||
"""Base class for Tesla Fleet device tracker entities."""
|
"""Base class for Tesla Fleet device tracker entities."""
|
||||||
|
|
||||||
_attr_latitude: float | None = None
|
|
||||||
_attr_longitude: float | None = None
|
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
vehicle: TeslaFleetVehicleData,
|
vehicle: TeslaFleetVehicleData,
|
||||||
@ -53,16 +50,6 @@ class TeslaFleetDeviceTrackerEntity(
|
|||||||
self._attr_latitude = state.attributes.get("latitude")
|
self._attr_latitude = state.attributes.get("latitude")
|
||||||
self._attr_longitude = state.attributes.get("longitude")
|
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):
|
class TeslaFleetDeviceTrackerLocationEntity(TeslaFleetDeviceTrackerEntity):
|
||||||
"""Vehicle Location device tracker Class."""
|
"""Vehicle Location device tracker Class."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user