Update powerwall for tesla_powerwall 0.5.0 which is async (#107164)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
bubonicbob 2024-01-10 13:21:53 -08:00 committed by GitHub
parent bdba6f41c9
commit c74bef265a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 401 additions and 209 deletions

View file

@ -4,15 +4,14 @@ from __future__ import annotations
from dataclasses import dataclass
from typing import TypedDict
from requests import Session
from tesla_powerwall import (
DeviceType,
GridStatus,
MetersAggregates,
MetersAggregatesResponse,
Powerwall,
PowerwallStatus,
SiteInfo,
SiteMaster,
PowerwallStatusResponse,
SiteInfoResponse,
SiteMasterResponse,
)
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -23,8 +22,8 @@ class PowerwallBaseInfo:
"""Base information for the powerwall integration."""
gateway_din: None | str
site_info: SiteInfo
status: PowerwallStatus
site_info: SiteInfoResponse
status: PowerwallStatusResponse
device_type: DeviceType
serial_numbers: list[str]
url: str
@ -35,8 +34,8 @@ class PowerwallData:
"""Point in time data for the powerwall integration."""
charge: float
site_master: SiteMaster
meters: MetersAggregates
site_master: SiteMasterResponse
meters: MetersAggregatesResponse
grid_services_active: bool
grid_status: GridStatus
backup_reserve: float | None
@ -49,4 +48,3 @@ class PowerwallRuntimeData(TypedDict):
api_instance: Powerwall
base_info: PowerwallBaseInfo
api_changed: bool
http_session: Session