al-one / hass-xiaomi-miot

Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices. 小米米家智能家居设备接入Hass集成
https://miot-spec.com
Apache License 2.0
4.14k stars 579 forks source link

"Detected blocking call to open inside the event loop" #1719

Open styphonthal opened 3 weeks ago

styphonthal commented 3 weeks ago

Getting this error when starting/rebooting. I am running HaOS, core version 2024.6.2, device zhimi.airp.cpa4.

2024-06-16 10:12:25.740 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'xiaomi_miot' at custom_components/xiaomi_miot/init.py, line 208: with open(os.path.dirname(file) + '/core/miot_specs_extend.json') as file: (offender: /config/custom_components/xiaomi_miot/init.py, line 208: with open(os.path.dirname(file) + '/core/miot_specs_extend.json') as file:), please create a bug report at https://github.com/al-one/hass-xiaomi-miot/issues Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in 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 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 402, in _async_setup_component result = await task File "/config/custom_components/xiaomi_miot/init.py", line 208, in async_setup with open(os.path.dirname(file) + '/core/miot_specs_extend.json') as file:

hmmbob commented 3 weeks ago

Duplicate of #1694