Skip to content

Commit

Permalink
🔧 fix filter device
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Oct 29, 2024
1 parent 4f9f1b5 commit 71acb6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions custom_components/xiaomi_miot/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions custom_components/xiaomi_miot/core/xiaomi_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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):
Expand Down

0 comments on commit 71acb6e

Please sign in to comment.