Allow setting of hvac_mode when setting temperature in ozw (#39853)

This commit is contained in:
Chris authored and GitHub committed 2020-09-09 17:08:43 +02:00
1 parent 74219663d6
commit 1f000e2c3e
2 files changed
+35 -11

No files matched your search

+6
View File
@@ -5,6 +5,7 @@ from typing import Optional, Tuple
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, ClimateEntity
from homeassistant.components.climate.const import (
ATTR_HVAC_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
CURRENT_HVAC_COOL,
@@ -252,6 +253,11 @@ class ZWaveClimateEntity(ZWaveDeviceEntity, ClimateEntity):
Must know if single or double setpoint.
"""
hvac_mode = kwargs.get(ATTR_HVAC_MODE)
if hvac_mode is not None:
await self.async_set_hvac_mode(hvac_mode)
if len(self._current_mode_setpoint_values) == 1:
setpoint = self._current_mode_setpoint_values[0]
target_temp = kwargs.get(ATTR_TEMPERATURE)