From 26c2cfd6537b5dadf72fcd057a3c484a0ff3e79f Mon Sep 17 00:00:00 2001 From: Alone Date: Mon, 29 Nov 2021 19:59:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B6=20improve=20for=20walking-pad=20(#?= =?UTF-8?q?261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_components/xiaomi_miot/__init__.py | 5 ++++- custom_components/xiaomi_miot/core/device_customizes.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_miot/__init__.py b/custom_components/xiaomi_miot/__init__.py index 2e66d4585..a9713b9fe 100644 --- a/custom_components/xiaomi_miot/__init__.py +++ b/custom_components/xiaomi_miot/__init__.py @@ -1118,7 +1118,10 @@ async def async_update(self): self._state = True if self._state_attrs.get('power') else False if self._miot_service: - for d in ['sensor', 'binary_sensor', 'switch', 'number', 'select', 'fan', 'cover']: + for d in [ + 'sensor', 'binary_sensor', 'switch', 'number', + 'select', 'fan', 'cover', 'number_select', + ]: pls = self.custom_config_list(f'{d}_properties') or [] if pls: self._update_sub_entities(pls, '*', domain=d) diff --git a/custom_components/xiaomi_miot/core/device_customizes.py b/custom_components/xiaomi_miot/core/device_customizes.py index b588caabf..fb832ac6c 100644 --- a/custom_components/xiaomi_miot/core/device_customizes.py +++ b/custom_components/xiaomi_miot/core/device_customizes.py @@ -436,7 +436,8 @@ 'sensor_properties': 'current_distance,current_step_count,current_calorie_consumption,' 'left_distance,left_time,working_time', 'number_properties': 'target_distance,target_time', - 'select_properties': 'mode,speed_level', + 'select_properties': 'mode', + 'number_select_properties': 'speed_level', }, }