Skip to content

路由器重新拨号导致wifi设备状态不更新 #1519

Description

@lydigaga

Describe the Bug / 描述问题

路由器每次重新拨号后,插件下的WiFi设备状态无法更新,中枢网关下的设备正常。得重新加载插件才能解决

How to Reproduce / 复现步骤

重新拨号100%复现

Expected Behavior / 预期结果

希望能解决拨号后设备不更新状态

Reproduce Time / 问题复现的时间点

2025-11-24 04:48:35

Home Assistant Logs / 系统日志

日志记录器: custom_components.xiaomi_home.miot.miot_client
来源: custom_components/xiaomi_home/miot/miot_client.py:1660
集成: Xiaomi Home (文档, 问题)
首次出现: 04:48:20 (13 次出现)
上次记录: 04:48:35

refresh props error, cloud, Cannot connect to host ha.api.io.mi.com:443 ssl:default [DNS server returned answer with no data], Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 117, in resolve resp = await self._resolver.getaddrinfo( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<5 lines>... ) ^ aiodns.error.DNSError: (1, 'DNS server returned answer with no data') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1532, in _create_direct_connection hosts = await self._resolve_host(host, port, traces=traces) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1148, in _resolve_host return await asyncio.shield(resolved_host_task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1179, in _resolve_host_with_throttle addrs = await self._resolver.resolve(host, port, family=self._family) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 126, in resolve raise OSError(None, msg) from exc OSError: [Errno None] DNS server returned answer with no data The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 1637, in __refresh_props_from_cloud results = await self._http.get_props_async( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ params=list(request_list.values())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_home/miot/miot_cloud.py", line 727, in get_props_async res_obj = await self.__mihome_api_post_async( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<5 lines>... ) ^ File "/config/custom_components/xiaomi_home/miot/miot_cloud.py", line 341, in __mihome_api_post_async http_res = await self._session.post( ^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... timeout=timeout) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 779, in _request resp = await handler(req) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 734, in _connect_and_send_request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ req, traces=traces, timeout=real_timeout ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 642, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1209, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1538, in _create_direct_connection raise ClientConnectorDNSError(req.connection_key, exc) from exc aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host ha.api.io.mi.com:443 ssl:default [DNS server returned answer with no data]
refresh props error, cloud, Object of type coroutine is not JSON serializable, Traceback (most recent call last): File "/config/custom_components/xiaomi_home/miot/miot_client.py", line 1637, in __refresh_props_from_cloud results = await self._http.get_props_async( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ params=list(request_list.values())) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_home/miot/miot_cloud.py", line 727, in get_props_async res_obj = await self.__mihome_api_post_async( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<5 lines>... ) ^ File "/config/custom_components/xiaomi_home/miot/miot_cloud.py", line 341, in __mihome_api_post_async http_res = await self._session.post( ^^^^^^^^^^^^^^^^^^^^^^^^^ ...<3 lines>... timeout=timeout) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 538, in _request data = payload.JsonPayload(json, dumps=self._json_serialize) File "/usr/local/lib/python3.13/site-packages/aiohttp/payload.py", line 951, in init dumps(value).encode(encoding), ~~~~~^^^^^^^ File "/usr/local/lib/python3.13/json/init.py", line 231, in dumps return _default_encoder.encode(obj) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^ File "/usr/local/lib/python3.13/json/encoder.py", line 200, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/lib/python3.13/json/encoder.py", line 261, in iterencode return _iterencode(o, 0) File "/usr/local/lib/python3.13/json/encoder.py", line 180, in default raise TypeError(f'Object of type {o.class.name} ' f'is not JSON serializable') TypeError: Object of type coroutine is not JSON serializable

Log Timezone / 日志时区

ShangHai

Home Assistant Core Version / Home Assistant Core 版本

2025.11.2

Home Assistant Operation System Version / Home Assistant Operation System 版本

20251105.0

Xiaomi Home Integration Version / 米家集成版本

v0.4.4

Additional Context / 其他说明

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions