From 17022333e75e5cbe6989c9ddd3f1c8e8499e86c2 Mon Sep 17 00:00:00 2001 From: Anarion Date: Sat, 16 Mar 2024 18:29:27 +0100 Subject: [PATCH] :bug: Fix humidity sensor creation. Fixes Humidity sensor is wrongly imported #56 --- custom_components/tech/climate.py | 2 +- custom_components/tech/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/tech/climate.py b/custom_components/tech/climate.py index 7a0bbbf..39f8370 100644 --- a/custom_components/tech/climate.py +++ b/custom_components/tech/climate.py @@ -108,7 +108,7 @@ def update_properties(self, device): self._temperature = None # Update humidity - if device[CONF_ZONE]["humidity"] is not None: + if device[CONF_ZONE]["humidity"] is not None and device[CONF_ZONE]["humidity"] >= 0: self._humidity = device[CONF_ZONE]["humidity"] else: self._humidity = None diff --git a/custom_components/tech/sensor.py b/custom_components/tech/sensor.py index c7b5ac1..cb4a646 100644 --- a/custom_components/tech/sensor.py +++ b/custom_components/tech/sensor.py @@ -217,7 +217,7 @@ def is_humidity_operating_device(device) -> bool: """ return ( - device[CONF_ZONE]["humidity"] is not None and device[CONF_ZONE]["humidity"] != 0 + device[CONF_ZONE]["humidity"] is not None and device[CONF_ZONE]["humidity"] >= 0 )