From 971223de197581524462b0ef001c15b8e65f218c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 17 Jul 2019 12:09:44 -0700 Subject: [PATCH] Only include target temp if has right support flag (#25193) * Only include target temp if has right support flag * Remove comma --- homeassistant/components/climate/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index f7ef8a71ce4..347cb275e42 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -31,7 +31,7 @@ from .const import ( SERVICE_SET_HVAC_MODE, SERVICE_SET_PRESET_MODE, SERVICE_SET_SWING_MODE, SERVICE_SET_TEMPERATURE, SUPPORT_AUX_HEAT, SUPPORT_FAN_MODE, SUPPORT_PRESET_MODE, SUPPORT_SWING_MODE, SUPPORT_TARGET_HUMIDITY, - SUPPORT_TARGET_TEMPERATURE_RANGE) + SUPPORT_TARGET_TEMPERATURE_RANGE, SUPPORT_TARGET_TEMPERATURE) from .reproduce_state import async_reproduce_states # noqa DEFAULT_MIN_TEMP = 7 @@ -176,14 +176,16 @@ class ClimateDevice(Entity): ATTR_MAX_TEMP: show_temp( self.hass, self.max_temp, self.temperature_unit, self.precision), - ATTR_TEMPERATURE: show_temp( - self.hass, self.target_temperature, self.temperature_unit, - self.precision), } if self.target_temperature_step: data[ATTR_TARGET_TEMP_STEP] = self.target_temperature_step + if supported_features & SUPPORT_TARGET_TEMPERATURE: + data[ATTR_TEMPERATURE] = show_temp( + self.hass, self.target_temperature, self.temperature_unit, + self.precision) + if supported_features & SUPPORT_TARGET_TEMPERATURE_RANGE: data[ATTR_TARGET_TEMP_HIGH] = show_temp( self.hass, self.target_temperature_high, self.temperature_unit,