From 35aef3c9d6c584486e626543a0481c526da868dd Mon Sep 17 00:00:00 2001 From: Robert Friedland Date: Thu, 25 Aug 2022 23:42:34 -0400 Subject: [PATCH] coalesce fan pct to 0 to avoid None comparison to int --- custom_components/ha_bedjet/climate.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/custom_components/ha_bedjet/climate.py b/custom_components/ha_bedjet/climate.py index 383080c..f1eea48 100644 --- a/custom_components/ha_bedjet/climate.py +++ b/custom_components/ha_bedjet/climate.py @@ -174,13 +174,14 @@ def max_temp(self): @property def fan_mode(self): - if self._fan_pct <= 10: + fan_pct = self._fan_pct or 0 + if fan_pct <= 10: return 'FAN_MIN' - if self._fan_pct <= 25: + if fan_pct <= 25: return 'FAN_LOW' - if self._fan_pct <= 50: + if fan_pct <= 50: return 'FAN_MEDIUM' - if self._fan_pct <= 75: + if fan_pct <= 75: return 'FAN_HIGH' return 'FAN_MAX'