Skip to content

Commit

Permalink
feat: update log level
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Jan 3, 2025
1 parent cc1b568 commit 4d8d539
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions custom_components/xiaomi_home/miot/miot_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,18 @@ async def __get_device_list_page_async(
name = device.get('name', None)
urn = device.get('spec_type', None)
model = device.get('model', None)
if did is None or name is None or urn is None or model is None:
_LOGGER.error(
'get_device_list, cloud, invalid device, %s', device)
if did is None or name is None:
_LOGGER.info(
'invalid device, cloud, %s', device)
continue
if urn is None or model is None:
_LOGGER.info(
'missing the urn|model field, cloud, %s', device)
continue
if did.startswith('miwifi.'):
# All devices with did starting with "miwifi." are routers
# that interface between the Xiaomi home cloud and the Xiaomi
# router cloud. These routers have all defined functions but
# have not been implemented, so they are all filtered out; some
# routers that are not "miwifi.*" also have this problem.
_LOGGER.info('ignore miwifi.* device, %s', did)
# The miwifi.* routers defined SPEC functions, but none of them
# were implemented.
_LOGGER.info('ignore miwifi.* device, cloud, %s', did)
continue
device_infos[did] = {
'did': did,
Expand Down Expand Up @@ -642,7 +643,7 @@ async def get_devices_async(
for did in dids:
if did not in results:
devices.pop(did, None)
_LOGGER.error('get device info failed, %s', did)
_LOGGER.info('get device info failed, %s', did)
continue
devices[did].update(results[did])
# Whether sub devices
Expand Down

0 comments on commit 4d8d539

Please sign in to comment.