* Add ws66i core integration * Remove all ws66i translations * Update ws66i unit tests to meet minimum code coverage * Update ws66i based on @bdraco review * General improvements after 2nd PR review * Disable entities if amp shutoff, set default source names, set 30sec polling * Add _attr_ and change async_on_unload * Improve entity generation * Implement coordinator * Made options fields required, retry connection on failed attempts, use ZoneStatus for attributes * Refactor WS66i entity properties, raise HomeAssistantError on restore service if no snapshot * Update to pyws66i v1.1 * Add quality scale of silver to manifest * Update config_flow test
30 lines
596 B
Python
30 lines
596 B
Python
"""The ws66i integration models."""
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from pyws66i import WS66i
|
|
|
|
from .coordinator import Ws66iDataUpdateCoordinator
|
|
|
|
# A dataclass is basically a struct in C/C++
|
|
|
|
|
|
@dataclass
|
|
class SourceRep:
|
|
"""Different representations of the amp sources."""
|
|
|
|
id_name: dict[int, str]
|
|
name_id: dict[str, int]
|
|
name_list: list[str]
|
|
|
|
|
|
@dataclass
|
|
class Ws66iData:
|
|
"""Data for the ws66i integration."""
|
|
|
|
host_ip: str
|
|
device: WS66i
|
|
sources: SourceRep
|
|
coordinator: Ws66iDataUpdateCoordinator
|
|
zones: list[int]
|