diff --git a/custom_components/xiaomi_miot/config_flow.py b/custom_components/xiaomi_miot/config_flow.py index e044bf98d..02e9b3833 100644 --- a/custom_components/xiaomi_miot/config_flow.py +++ b/custom_components/xiaomi_miot/config_flow.py @@ -688,6 +688,7 @@ async def async_step_cloud_filter(self, user_input=None): cfg = self.cloud.to_config() or {} cfg.update({ CONF_CONN_MODE: prev_input.get(CONF_CONN_MODE), + 'filter_models': prev_input.get('filter_models'), 'disable_message': prev_input.get('disable_message'), 'disable_scene_history': prev_input.get('disable_scene_history'), **user_input, diff --git a/custom_components/xiaomi_miot/core/xiaomi_cloud.py b/custom_components/xiaomi_miot/core/xiaomi_cloud.py index 0e19ba7b2..51757c2d7 100644 --- a/custom_components/xiaomi_miot/core/xiaomi_cloud.py +++ b/custom_components/xiaomi_miot/core/xiaomi_cloud.py @@ -300,9 +300,9 @@ async def get_device_list(self): return None async def get_all_devices(self, homes=None): - dvs = await self.get_device_list() or [] + dvs = [] if not isinstance(homes, list): - return dvs + return await self.get_device_list() or [] for home in homes: hid = int(home.get('id', 0)) uid = int(home.get('uid', 0)) @@ -324,7 +324,7 @@ async def get_all_devices(self, homes=None): rdt = rdt.get('result') or {} dvs.extend(rdt.get('device_info') or {}) start_did = rdt.get('max_did') or '' - has_more = rdt.get('has_more') + has_more = rdt.get('has_more') and start_did return dvs async def get_home_devices(self):