mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-12-27 00:19:34 +08:00
perf: remove unused device info (#1574)
Some checks failed
Tests / check-rule-format (push) Failing after -8m20s
Validate / validate-hassfest (push) Failing after -8m21s
Validate / validate-hacs (push) Failing after -8m14s
Validate / validate-lint (push) Failing after -8m22s
Validate / validate-setup (push) Failing after -8m20s
Some checks failed
Tests / check-rule-format (push) Failing after -8m20s
Validate / validate-hassfest (push) Failing after -8m21s
Validate / validate-hacs (push) Failing after -8m14s
Validate / validate-lint (push) Failing after -8m22s
Validate / validate-setup (push) Failing after -8m20s
This commit is contained in:
@@ -1256,7 +1256,15 @@ class MIoTClient:
|
|||||||
) -> None:
|
) -> None:
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'gateway devices list changed, %s, %s', mips.group_id, did_list)
|
'gateway devices list changed, %s, %s', mips.group_id, did_list)
|
||||||
payload: dict = {'filter': {'did': did_list}}
|
payload: dict = {
|
||||||
|
'filter': {
|
||||||
|
'did': did_list
|
||||||
|
},
|
||||||
|
'info': [
|
||||||
|
'name', 'model', 'urn',
|
||||||
|
'online', 'specV2Access', 'pushAvailable'
|
||||||
|
]
|
||||||
|
}
|
||||||
gw_list = await mips.get_dev_list_async(
|
gw_list = await mips.get_dev_list_async(
|
||||||
payload=json.dumps(payload))
|
payload=json.dumps(payload))
|
||||||
if gw_list is None:
|
if gw_list is None:
|
||||||
@@ -1590,7 +1598,14 @@ class MIoTClient:
|
|||||||
if not mips.mips_state:
|
if not mips.mips_state:
|
||||||
_LOGGER.debug('local mips disconnect, skip refresh, %s', group_id)
|
_LOGGER.debug('local mips disconnect, skip refresh, %s', group_id)
|
||||||
return
|
return
|
||||||
gw_list: dict = await mips.get_dev_list_async()
|
payload: dict = {
|
||||||
|
'info': [
|
||||||
|
'name', 'model', 'urn',
|
||||||
|
'online', 'specV2Access', 'pushAvailable'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
gw_list: dict = await mips.get_dev_list_async(
|
||||||
|
payload=json.dumps(payload))
|
||||||
if gw_list is None:
|
if gw_list is None:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
'refresh gw devices with group_id failed, %s, %s',
|
'refresh gw devices with group_id failed, %s, %s',
|
||||||
|
|||||||
@@ -601,15 +601,8 @@ class MIoTHttpClient:
|
|||||||
'bssid': device.get('bssid', None),
|
'bssid': device.get('bssid', None),
|
||||||
'order_time': device.get('orderTime', 0),
|
'order_time': device.get('orderTime', 0),
|
||||||
'fw_version': device.get('extra', {}).get(
|
'fw_version': device.get('extra', {}).get(
|
||||||
'fw_version', 'unknown'),
|
|
||||||
}
|
|
||||||
if isinstance(device.get('extra', None), dict) and device['extra']:
|
|
||||||
device_infos[did]['fw_version'] = device['extra'].get(
|
|
||||||
'fw_version', None)
|
'fw_version', None)
|
||||||
device_infos[did]['mcu_version'] = device['extra'].get(
|
}
|
||||||
'mcu_version', None)
|
|
||||||
device_infos[did]['platform'] = device['extra'].get(
|
|
||||||
'platform', None)
|
|
||||||
|
|
||||||
next_start_did = res_obj.get('next_start_did', None)
|
next_start_did = res_obj.get('next_start_did', None)
|
||||||
if res_obj.get('has_more', False) and next_start_did:
|
if res_obj.get('has_more', False) and next_start_did:
|
||||||
|
|||||||
@@ -1394,19 +1394,9 @@ class MipsLocalClient(_MipsClient):
|
|||||||
continue
|
continue
|
||||||
device_list[did] = {
|
device_list[did] = {
|
||||||
'did': did,
|
'did': did,
|
||||||
'name': name,
|
|
||||||
'urn': urn,
|
|
||||||
'model': model,
|
|
||||||
'online': info.get('online', False),
|
'online': info.get('online', False),
|
||||||
'icon': info.get('icon', None),
|
|
||||||
'fw_version': None,
|
|
||||||
'home_id': '',
|
|
||||||
'home_name': '',
|
|
||||||
'room_id': info.get('roomId', ''),
|
|
||||||
'room_name': info.get('roomName', ''),
|
|
||||||
'specv2_access': info.get('specV2Access', False),
|
'specv2_access': info.get('specV2Access', False),
|
||||||
'push_available': info.get('pushAvailable', False),
|
'push_available': info.get('pushAvailable', False)
|
||||||
'manufacturer': model.split('.')[0],
|
|
||||||
}
|
}
|
||||||
return device_list
|
return device_list
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user