mirror of
https://github.com/home-assistant/core.git
synced 2026-07-18 20:13:24 +01:00
b5528de807
* Adding Energy * Adding Energy * Work in progress * Add fixtures * Add product info * Add sensors * Add icons * Update metadata * Use SensorEntityDescription for Energy * Use ENERGY_STORAGE * Add tests * Fix coverage * Update wall connector precision and units * Change devices * Fix serial number * Add icons and VIN to wall connector * Fix serial number again * Update snapshots * Use timestamp for minutes to arrival * Cleanup snapshot * Improvements * Update fixture * Add "code" to translations * Add "code" to snapshot * Use async_add_entities once * Disable a bunch of sensors * Ruff * Improve fixture and test coverage * Regen Snapshots * Add init to coordinator
41 lines
894 B
Python
41 lines
894 B
Python
"""The Teslemetry integration models."""
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
from dataclasses import dataclass
|
|
|
|
from tesla_fleet_api import EnergySpecific, VehicleSpecific
|
|
|
|
from .coordinator import (
|
|
TeslemetryEnergyDataCoordinator,
|
|
TeslemetryVehicleDataCoordinator,
|
|
)
|
|
|
|
|
|
@dataclass
|
|
class TeslemetryData:
|
|
"""Data for the Teslemetry integration."""
|
|
|
|
vehicles: list[TeslemetryVehicleData]
|
|
energysites: list[TeslemetryEnergyData]
|
|
|
|
|
|
@dataclass
|
|
class TeslemetryVehicleData:
|
|
"""Data for a vehicle in the Teslemetry integration."""
|
|
|
|
api: VehicleSpecific
|
|
coordinator: TeslemetryVehicleDataCoordinator
|
|
vin: str
|
|
wakelock = asyncio.Lock()
|
|
|
|
|
|
@dataclass
|
|
class TeslemetryEnergyData:
|
|
"""Data for a vehicle in the Teslemetry integration."""
|
|
|
|
api: EnergySpecific
|
|
coordinator: TeslemetryEnergyDataCoordinator
|
|
id: int
|
|
info: dict[str, str]
|