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: