From 39412dc930ae94431e4de12e1d91871ecb7643b8 Mon Sep 17 00:00:00 2001 From: kennedyshead Date: Tue, 6 Nov 2018 15:18:46 +0100 Subject: [PATCH] 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 --- homeassistant/components/climate/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/climate/__init__.py b/homeassistant/components/climate/__init__.py index a165521f0bd..4b73e24fb41 100644 --- a/homeassistant/components/climate/__init__.py +++ b/homeassistant/components/climate/__init__.py @@ -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