From c6f3c239bbc45fd428eae2bc2b968723bfd7df8b Mon Sep 17 00:00:00 2001 From: kennedyshead <magnusknutas@gmail.com> Date: Tue, 6 Nov 2018 13:08:58 +0100 Subject: [PATCH] Melissa state_attributes (#18201) * Melissa attributes * overide device_state_attributes rather than state_attributes * Selected attributes * Adding current humidity rather than a state_attribute --- homeassistant/components/climate/melissa.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/climate/melissa.py b/homeassistant/components/climate/melissa.py index bfb18fa0a4c..25beedfe0dd 100644 --- a/homeassistant/components/climate/melissa.py +++ b/homeassistant/components/climate/melissa.py @@ -88,6 +88,12 @@ class MelissaClimate(ClimateDevice): if self._data: return self._data[self._api.TEMP] + @property + def current_humidity(self): + """Return the current humidity value.""" + if self._data: + return self._data[self._api.HUMIDITY] + @property def target_temperature_step(self): """Return the supported step of target temperature.""" @@ -113,8 +119,9 @@ class MelissaClimate(ClimateDevice): @property def target_temperature(self): """Return the temperature we try to reach.""" - if self._cur_settings is not None: - return self._cur_settings[self._api.TEMP] + if self._cur_settings is None: + return None + return self._cur_settings[self._api.TEMP] @property def state(self):