From f7e9acbd3f06faa0819921cef95ae6d7b3a4531f Mon Sep 17 00:00:00 2001 From: fustom Date: Fri, 10 Jan 2025 16:23:32 +0100 Subject: [PATCH] Fix set hvac mode for BSB devices (#390) --- custom_components/ariston/climate.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/custom_components/ariston/climate.py b/custom_components/ariston/climate.py index 0447e91..0f4f1a8 100644 --- a/custom_components/ariston/climate.py +++ b/custom_components/ariston/climate.py @@ -4,7 +4,7 @@ import logging -from ariston.const import PlantMode, ZoneMode +from ariston.const import PlantMode, ZoneMode, BsbZoneMode from homeassistant.components.climate import ( ClimateEntity, ClimateEntityFeature, @@ -247,8 +247,13 @@ async def async_set_hvac_mode(self, hvac_mode): ) else: await self.device.async_set_zone_mode(ZoneMode.MANUAL, self.zone) - else: - await self.device.async_set_zone_mode(hvac_mode, self.zone) + # Plant mode is not supported (BSB device) + elif hvac_mode == HVACMode.OFF: + await self.device.async_set_zone_mode(BsbZoneMode.OFF, self.zone) + elif hvac_mode == HVACMode.AUTO: + await self.device.async_set_zone_mode(BsbZoneMode.TIME_PROGRAM, self.zone) + elif hvac_mode == HVACMode.HEAT: + await self.device.async_set_zone_mode(BsbZoneMode.MANUAL, self.zone) self.async_write_ha_state()