hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
5.41k stars 1.29k forks source link

“Xiaomi Miot Auto” report errors “配置小米账户 ⚠️ [Errno 21] Is a directory: '/etc/localtime'” #4017

Closed pudding1111 closed 2 months ago

pudding1111 commented 2 months ago

System Health details

System Information

version core-2024.8.3
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.40
arch x86_64
timezone Asia/Shanghai
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 4980 Installed Version | 2.0.0 Stage | running Available Repositories | 1389 Downloaded Repositories | 2
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 2 -- | -- resources | 0 views | 1 mode | storage
Recorder oldest_recorder_run | 2024年8月26日 17:30 -- | -- current_recorder_run | 2024年8月30日 15:14 estimated_db_size | 0.99 MiB database_engine | sqlite database_version | 3.45.3

Checklist

Describe the issue

image “Xiaomi Miot Auto” report errors “配置小米账户 ⚠️ [Errno 21] Is a directory: '/etc/localtime'”

Reproduction steps

1.进入 2. 3. ...

Debug logs

2024-08-30 07:14:47.019 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/etc/localtime', 'rb') inside the event loop by custom integration 'xiaomi_miot' at custom_components/xiaomi_miot/core/xiaomi_cloud.py, line 43: super().__init__(username, password) (offender: /usr/local/lib/python3.12/site-packages/tzlocal/unix.py, line 189: with open(tzpath, "rb") as tzfile:), please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 541, in start
    task = asyncio.Task(coro, loop=loop, eager_start=True)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 366, in async_configure
    result = await self._async_configure(flow_id, user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 413, in _async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 516, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
  File "/config/custom_components/xiaomi_miot/config_flow.py", line 308, in async_step_cloud
    await check_xiaomi_account(self.hass, user_input, errors, renew_devices=True)
  File "/config/custom_components/xiaomi_miot/config_flow.py", line 118, in check_xiaomi_account
    mic = await MiotCloud.from_token(hass, user_input, login=False)
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 599, in from_token
    mic = MiotCloud(
  File "/config/custom_components/xiaomi_miot/core/xiaomi_cloud.py", line 43, in __init__
    super().__init__(username, password)

2024-08-30 07:14:47.020 ERROR (MainThread) [custom_components.xiaomi_miot.config_flow] Setup xiaomi cloud for user: 187****3510 failed: [Errno 21] Is a directory: '/etc/localtime'
2024-08-30 07:19:23.729 ERROR (MainThread) [custom_components.xiaomi_miot.config_flow] Setup xiaomi cloud for user: 187****3510 failed: [Errno 21] Is a directory: '/etc/localtime'
2024-08-30 08:38:50.501 ERROR (MainThread) [custom_components.xiaomi_miot.config_flow] Setup xiaomi cloud for user: 187****3510 failed: [Errno 21] Is a directory: '/etc/localtime'

Diagnostics dump

使用的openwrt版本信息: root@iStoreOS:~# uname -a Linux iStoreOS 6.6.40 #0 SMP PREEMPT_DYNAMIC Wed Jul 31 02:52:47 2024 x86_64 GNU/Linux root@iStoreOS:~# uname -r 6.6.40 使用的openwrt作者以及链接地址 https://github.com/sirpdboy/openwrt?tab=readme-ov-file#%E5%9B%BA%E4%BB%B6%E4%B8%8B%E8%BD%BD image

hacs-bot[bot] commented 2 months ago

Make sure you have read the issue guidelines and that you filled out the entire template.

If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a :+1: reaction to the issue description. Thanks! :+1: