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 <goran.johansson@shiftit.se> --------- Co-authored-by: G Johansson <goran.johansson@shiftit.se>
This commit is contained in:
parent
fea4af69d7
commit
38cea8f31c
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue