From ecc514b7e487e5dc4a9f740070c21c21d3dae04d Mon Sep 17 00:00:00 2001 From: Jeff Wilson Date: Sun, 11 Dec 2016 18:48:47 -0500 Subject: [PATCH] Use current mode to determine which temperature attributes to use (#4858) --- homeassistant/components/climate/nest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/climate/nest.py b/homeassistant/components/climate/nest.py index ab41c10e6d1..e098c3c3709 100644 --- a/homeassistant/components/climate/nest.py +++ b/homeassistant/components/climate/nest.py @@ -155,8 +155,8 @@ class NestThermostat(ClimateDevice): """Set new target temperature.""" target_temp_low = kwargs.get(ATTR_TARGET_TEMP_LOW) target_temp_high = kwargs.get(ATTR_TARGET_TEMP_HIGH) - if target_temp_low is not None and target_temp_high is not None: - if self._mode == STATE_HEAT_COOL: + if self._mode == STATE_HEAT_COOL: + if target_temp_low is not None and target_temp_high is not None: temp = (target_temp_low, target_temp_high) else: temp = kwargs.get(ATTR_TEMPERATURE)