mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-06-21 15:20:00 +08:00
fix: fix lan ctrl filter logic (#303)
* style: rename devices_filter to homes_select * fix: fix miot_lan update_devices * fix: async blocking call
This commit is contained in:
@ -1028,6 +1028,7 @@ class MIoTClient:
|
||||
self._miot_lan.update_devices(devices={
|
||||
did: {
|
||||
'token': info['token'],
|
||||
'model': info['model'],
|
||||
'connect_type': info['connect_type']}
|
||||
for did, info in self._device_list_cache.items()
|
||||
if 'token' in info and 'connect_type' in info
|
||||
@ -1291,6 +1292,7 @@ class MIoTClient:
|
||||
self._miot_lan.update_devices(devices={
|
||||
did: {
|
||||
'token': info['token'],
|
||||
'model': info['model'],
|
||||
'connect_type': info['connect_type']}
|
||||
for did, info in self._device_list_cache.items()
|
||||
if 'token' in info and 'connect_type' in info
|
||||
|
@ -603,8 +603,9 @@ class MIoTLan:
|
||||
_LOGGER.info('no valid net_ifs')
|
||||
return
|
||||
try:
|
||||
self._profile_models = load_yaml_file(
|
||||
yaml_file=gen_absolute_path(self.PROFILE_MODELS_FILE))
|
||||
self._profile_models = await self._main_loop.run_in_executor(
|
||||
None, load_yaml_file,
|
||||
gen_absolute_path(self.PROFILE_MODELS_FILE))
|
||||
except Exception as err: # pylint: disable=broad-exception-caught
|
||||
_LOGGER.error('load profile models error, %s', err)
|
||||
self._profile_models = {}
|
||||
|
Reference in New Issue
Block a user