Home Assistant Unofficial Reference 2024.12.1
models.py
Go to the documentation of this file.
1 """The Tessie integration models."""
2 
3 from __future__ import annotations
4 
5 from dataclasses import dataclass
6 
7 from tesla_fleet_api import EnergySpecific
8 
9 from homeassistant.helpers.device_registry import DeviceInfo
10 
11 from .coordinator import (
12  TessieEnergySiteInfoCoordinator,
13  TessieEnergySiteLiveCoordinator,
14  TessieStateUpdateCoordinator,
15 )
16 
17 
18 @dataclass
19 class TessieData:
20  """Data for the Tessie integration."""
21 
22  vehicles: list[TessieVehicleData]
23  energysites: list[TessieEnergyData]
24 
25 
26 @dataclass
28  """Data for a Energy Site in the Tessie integration."""
29 
30  api: EnergySpecific
31  live_coordinator: TessieEnergySiteLiveCoordinator
32  info_coordinator: TessieEnergySiteInfoCoordinator
33  id: int
34  device: DeviceInfo
35 
36 
37 @dataclass
39  """Data for a Tessie vehicle."""
40 
41  data_coordinator: TessieStateUpdateCoordinator
42  device: DeviceInfo
43  vin: str