diff --git a/config.toml b/config.toml index 498e003..0c37600 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ [logging] -level = "DEBUG" +# level = "DEBUG" [homeassistant] entity = "climate.chaudiere" diff --git a/oin_thermostat/mqtt.py b/oin_thermostat/mqtt.py index e6279ac..82ecfc6 100644 --- a/oin_thermostat/mqtt.py +++ b/oin_thermostat/mqtt.py @@ -1,7 +1,7 @@ import json import logging from collections.abc import Callable -from typing import Any +from typing import Any, TypedDict import paho.mqtt.client as mqtt from paho.mqtt.enums import CallbackAPIVersion, MQTTErrorCode @@ -12,6 +12,14 @@ from .select import Selector logger = logging.getLogger(__name__) +class HAOptions(TypedDict): + dev: dict[str, str] + o: dict[str, str] + availability_topic: str + state_topic: str + cmps: dict[str, dict[str, str]] + + class HAClient: def __init__( self, @@ -38,7 +46,7 @@ class HAClient: self.selector = Selector(self.send_data) @property - def ha_options(self) -> dict[str, Any]: + def ha_options(self) -> HAOptions: return { "dev": { "ids": "oin",