mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Use shorthand attributes in tesla_fleet device tracker (#126736)
This commit is contained in:
@@ -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."""
|
||||||
|
Reference in New Issue
Block a user