mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
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
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
|
ATTR_HVAC_MODE,
|
||||||
ATTR_TARGET_TEMP_HIGH,
|
ATTR_TARGET_TEMP_HIGH,
|
||||||
ATTR_TARGET_TEMP_LOW,
|
ATTR_TARGET_TEMP_LOW,
|
||||||
ClimateEntity,
|
ClimateEntity,
|
||||||
@ -161,6 +162,9 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||||||
):
|
):
|
||||||
raise ValueError("Invalid temperature change requested")
|
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)
|
await self.coordinator.api.set_temperature(self.device["location"], data)
|
||||||
|
|
||||||
@plugwise_command
|
@plugwise_command
|
||||||
|
Loading…
x
Reference in New Issue
Block a user