work: Изменил конфиг сервиса вытяжки для реальной платы. Добавил yaml конфигурацию платы. Сейчас доступны MQTT -прием статуса и управление реле.

This commit is contained in:
2026-09-22 21:16:14 +03:00
parent 32f3fc754f
commit 8d61712642
12 changed files with 812 additions and 465 deletions
+39
View File
@@ -0,0 +1,39 @@
from dataclasses import asdict, dataclass
from datetime import datetime
@dataclass(frozen=True, slots=True)
class ElicaState:
mqtt_connected: bool = False
device_online: bool = False
last_message_at: datetime | None = None
firmware: str | None = None
uptime_seconds: int | None = None
wifi_rssi: int | None = None
# Фактические состояния OUT1-OUT8,
# полученные от ESPHome через MQTT.
relay_states: tuple[bool, ...] = (
False,
False,
False,
False,
False,
False,
False,
False,
)
def to_dict(self) -> dict:
result = asdict(self)
if result["last_message_at"] is not None:
result["last_message_at"] = (
result["last_message_at"].isoformat()
)
return result