From 82028bbb75455601b9643bbc5cdb3a8432243b66 Mon Sep 17 00:00:00 2001 From: Alone Date: Fri, 22 Nov 2024 18:43:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A2=20improve=20for=20number=20sensor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miot/sensor.py b/custom_components/xiaomi_miot/sensor.py index d48db091e..c52bd559c 100644 --- a/custom_components/xiaomi_miot/sensor.py +++ b/custom_components/xiaomi_miot/sensor.py @@ -133,7 +133,7 @@ def get_state(self) -> dict: def set_state(self, data: dict): value = data.get(self.attr) prop = self._miot_property - if prop.value_range: + if prop and prop.value_range: if not prop.range_min() <= value <= prop.range_max(): value = None if value is not None: