diff --git a/ariston/__init__.py b/ariston/__init__.py index fcfd805..5958362 100644 --- a/ariston/__init__.py +++ b/ariston/__init__.py @@ -23,13 +23,14 @@ from .nuos_split_device import AristonNuosSplitDevice from .base_device import AristonBaseDevice from .velis_base_device import AristonVelisBaseDevice +from .lydos_device import AristonLydosDevice _LOGGER = logging.getLogger(__name__) _MAP_WHE_TYPES_TO_CLASS: dict[int, Type[AristonVelisBaseDevice]] = { WheType.Evo.value: AristonEvoOneDevice, WheType.LydosHybrid.value: AristonLydosHybridDevice, - WheType.Lydos.value: AristonEvoDevice, + WheType.Lydos.value: AristonLydosDevice, WheType.NuosSplit.value: AristonNuosSplitDevice, WheType.Andris2.value: AristonEvoDevice, WheType.Evo2.value: AristonEvoDevice, @@ -37,6 +38,7 @@ WheType.Lux.value: AristonLuxDevice, } + class Ariston: """Ariston class""" diff --git a/ariston/lydos_device.py b/ariston/lydos_device.py new file mode 100644 index 0000000..95a8d14 --- /dev/null +++ b/ariston/lydos_device.py @@ -0,0 +1,39 @@ +"""Evo device class for Ariston module.""" + +from __future__ import annotations + +import logging + +from .const import ( + EvoDeviceProperties, + LuxPlantMode, + WaterHeaterMode, +) +from .evo_device import AristonEvoDevice + +_LOGGER = logging.getLogger(__name__) + + +class AristonLydosDevice(AristonEvoDevice): + """Class representing a physical Lydos Wi-Fi device, it's state and properties.""" + + @property + def water_heater_mode(self) -> type[WaterHeaterMode]: + """Return the water heater mode class""" + return LuxPlantMode + + def set_water_heater_operation_mode(self, operation_mode: str): + """Set water heater operation mode""" + self.api.set_evo_mode(self.gw, self.water_heater_mode[operation_mode]) + self.data[EvoDeviceProperties.MODE] = self.water_heater_mode[ + operation_mode + ].value + + async def async_set_water_heater_operation_mode(self, operation_mode: str): + """Async set water heater operation mode""" + await self.api.async_set_evo_mode( + self.gw, self.water_heater_mode[operation_mode] + ) + self.data[EvoDeviceProperties.MODE] = self.water_heater_mode[ + operation_mode + ].value