From 38cea8f31c81c4a9f5d065567290dc7abe615062 Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Sun, 13 Aug 2023 12:39:46 +0200 Subject: [PATCH] Plugwise climate: add HVAC_Mode handling to set_temperature() (#98273) * Add HVAC_Mode handling to set_temperature() * Move added code down, as suggested * Implement walrus as suggested Co-authored-by: G Johansson --------- Co-authored-by: G Johansson --- homeassistant/components/plugwise/climate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homeassistant/components/plugwise/climate.py b/homeassistant/components/plugwise/climate.py index e83b76a76da..610ffa34d7c 100644 --- a/homeassistant/components/plugwise/climate.py +++ b/homeassistant/components/plugwise/climate.py @@ -4,6 +4,7 @@ from __future__ import annotations from typing import Any from homeassistant.components.climate import ( + ATTR_HVAC_MODE, ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, ClimateEntity, @@ -161,6 +162,9 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity): ): raise ValueError("Invalid temperature change requested") + if mode := kwargs.get(ATTR_HVAC_MODE): + await self.async_set_hvac_mode(mode) + await self.coordinator.api.set_temperature(self.device["location"], data) @plugwise_command