Adding current_humidity to attributes if its not None. (#18261)

* Adding current humidity if not None

* Removed the logic in supported feature

* More appropriate placement
pull/18269/head
kennedyshead 2018-11-06 15:18:46 +01:00 committed by Paulus Schoutsen
parent 2e517ab6bc
commit 39412dc930
1 changed files with 3 additions and 1 deletions

View File

@ -249,9 +249,11 @@ class ClimateDevice(Entity):
self.hass, self.target_temperature_low, self.temperature_unit,
self.precision)
if self.current_humidity is not None:
data[ATTR_CURRENT_HUMIDITY] = self.current_humidity
if supported_features & SUPPORT_TARGET_HUMIDITY:
data[ATTR_HUMIDITY] = self.target_humidity
data[ATTR_CURRENT_HUMIDITY] = self.current_humidity
if supported_features & SUPPORT_TARGET_HUMIDITY_LOW:
data[ATTR_MIN_HUMIDITY] = self.min_humidity