From 7aceb0493ce00c5f84cf171a0c7cd9aa6d649444 Mon Sep 17 00:00:00 2001 From: LiShuzhen Date: Wed, 5 Mar 2025 14:42:33 +0800 Subject: [PATCH] fix: fan-level property in thermostat service --- custom_components/xiaomi_home/climate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_home/climate.py b/custom_components/xiaomi_home/climate.py index 42897d7..58f1bdb 100644 --- a/custom_components/xiaomi_home/climate.py +++ b/custom_components/xiaomi_home/climate.py @@ -189,7 +189,7 @@ class FeaturePresetMode(MIoTServiceEntity, ClimateEntity): for prop in self.entity_data.props: if prop.name == prop_name and prop.service.name == service_name: if not prop.value_list: - _LOGGER.error('invalid %s %s value_list, %s',service_name, + _LOGGER.error('invalid %s %s value_list, %s', service_name, prop_name, self.entity_id) continue self._mode_map = prop.value_list.to_map() @@ -229,7 +229,9 @@ class FeatureFanMode(MIoTServiceEntity, ClimateEntity): super().__init__(miot_device=miot_device, entity_data=entity_data) # properties for prop in entity_data.props: - if prop.name == 'fan-level' and prop.service.name == 'fan-control': + if (prop.name == 'fan-level' and + (prop.service.name == 'fan-control' or + prop.service.name == 'thermostat')): if not prop.value_list: _LOGGER.error('invalid fan-level value_list, %s', self.entity_id)