Melissa state_attributes (#18201)

* Melissa attributes

* overide device_state_attributes rather than state_attributes

* Selected attributes

* Adding current humidity rather than a state_attribute
This commit is contained in:
kennedyshead 2018-11-06 13:08:58 +01:00 committed by Paulus Schoutsen
parent 34d7758b4a
commit c6f3c239bb

View file

@ -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):