From 0d607ae5528986839b1712dc17f8ab46f2c7f903 Mon Sep 17 00:00:00 2001 From: fustom Date: Mon, 5 Feb 2024 20:12:42 +0100 Subject: [PATCH] LydosHybrid: add anti cooling temperature (#133) --- ariston/const.py | 4 ++-- ariston/lydos_hybrid_device.py | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ariston/const.py b/ariston/const.py index 0ed9d91..1727514 100644 --- a/ariston/const.py +++ b/ariston/const.py @@ -494,8 +494,8 @@ class SeDeviceSettings: SE_MAX_SETPOINT_TEMPERATURE_MAX: Final[str] = "SeMaxSetpointTemperatureMax" SE_MAX_SETPOINT_TEMPERATURE_MIN: Final[str] = "SeMaxSetpointTemperatureMin" SE_ANTI_COOLING_TEMPERATURE: Final[str] = "SeAntiCoolingTemperature" - SE_ANTI_COOLING_TEMPERATURE_MAX: Final[str] = "SeAntiCoolingTemperatureMin" - SE_ANTI_COOLING_TEMPERATURE_MIN: Final[str] = "SeAntiCoolingTemperatureMax" + SE_ANTI_COOLING_TEMPERATURE_MAX: Final[str] = "SeAntiCoolingTemperatureMax" + SE_ANTI_COOLING_TEMPERATURE_MIN: Final[str] = "SeAntiCoolingTemperatureMin" SE_MAX_GREEN_SETPOINT_TEMPERATURE: Final[str] = "SeMaxGreenSetpointTemperature" SE_HEATING_RATE: Final[str] = "SeHeatingRate" SE_NIGHT_BEGIN_AS_MINUTES: Final[str] = "SeNightBeginAsMinutes" diff --git a/ariston/lydos_hybrid_device.py b/ariston/lydos_hybrid_device.py index e173fa3..12bd5ac 100644 --- a/ariston/lydos_hybrid_device.py +++ b/ariston/lydos_hybrid_device.py @@ -76,6 +76,21 @@ def anti_cooling_value(self) -> int: """Get anti cooling value""" return self.plant_settings.get(SeDeviceSettings.SE_ANTI_COOLING_ON_OFF, 0) + @property + def anti_cooling_temperature_value(self) -> int: + """Get anti cooling temperature value""" + return self.plant_settings.get(SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE, 0) + + @property + def anti_cooling_temperature_maximum(self) -> int: + """Get anti cooling temperature maximum""" + return self.plant_settings.get(SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE_MAX, 0) + + @property + def anti_cooling_temperature_minimum(self) -> int: + """Get anti cooling temperature minimum""" + return self.plant_settings.get(SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE_MIN, 0) + def set_water_heater_operation_mode(self, operation_mode: str): """Set water heater operation mode""" self.api.set_lydos_mode(self.gw, LydosPlantMode[operation_mode]) @@ -139,3 +154,25 @@ async def async_set_anti_cooling_value(self, anti_cooling: float) -> None: 1.0 if self.anti_cooling_value else 0.0, ) self.plant_settings[SeDeviceSettings.SE_ANTI_COOLING_ON_OFF] = anti_cooling + + def set_cooling_temperature_value(self, temperature: float) -> None: + """Set cooling temperature value""" + self.api.set_velis_plant_setting( + self.plant_data, + self.gw, + SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE, + temperature, + self.anti_cooling_temperature_value, + ) + self.plant_settings[SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE] = temperature + + async def async_set_cooling_temperature_value(self, temperature: float) -> None: + """Async set cooling temperature value""" + await self.api.async_set_velis_plant_setting( + self.plant_data, + self.gw, + SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE, + temperature, + self.anti_cooling_temperature_value, + ) + self.plant_settings[SeDeviceSettings.SE_ANTI_COOLING_TEMPERATURE] = temperature