1 """Device Tracker platform for Tessie integration."""
3 from __future__
import annotations
10 from .
import TessieConfigEntry
11 from .entity
import TessieEntity
12 from .models
import TessieVehicleData
19 entry: TessieConfigEntry,
20 async_add_entities: AddEntitiesCallback,
22 """Set up the Tessie device tracker platform from a config entry."""
23 data = entry.runtime_data
28 TessieDeviceTrackerLocationEntity,
29 TessieDeviceTrackerRouteEntity,
31 for vehicle
in data.vehicles
36 """Base class for Tessie Tracker Entities."""
40 vehicle: TessieVehicleData,
42 """Initialize the device tracker."""
47 """Vehicle Location Device Tracker Class."""
53 """Return the longitude of the device tracker."""
54 return self.
getget(
"drive_state_longitude")
58 """Return the latitude of the device tracker."""
59 return self.
getget(
"drive_state_latitude")
63 """Return device state attributes."""
65 "heading": self.
getget(
"drive_state_heading"),
66 "speed": self.
getget(
"drive_state_speed"),
71 """Vehicle Navigation Device Tracker Class."""
77 """Return the longitude of the device tracker."""
78 return self.
getget(
"drive_state_active_route_longitude")
82 """Return the latitude of the device tracker."""
83 return self.
getget(
"drive_state_active_route_latitude")
None __init__(self, TessieVehicleData vehicle)
dict[str, StateType]|None extra_state_attributes(self)
float|None latitude(self)
float|None longitude(self)
float|None longitude(self)
float|None latitude(self)
Any get(self, str|None key=None, Any|None default=None)
None async_setup_entry(HomeAssistant hass, TessieConfigEntry entry, AddEntitiesCallback async_add_entities)