Sian-Lee-SA / Home-Assistant-Switch-Manager

Switch manager is a centralised component to handle button pushes for your wireless switches. This includes anything passed through the event bus. The component relies on switch blueprints which is easily made to allow GUI configuration of your switches and their button pushes. This helps remove clutter from the automations.
Other
232 stars 85 forks source link

Error event loop #239

Closed Floordb closed 1 month ago

Floordb commented 3 months ago

Logger: homeassistant.util.loop Bron: util/loop.py:136 Eerst voorgekomen: 21:22:36 (2 gebeurtenissen) Laatst gelogd: 21:22:36

Detected blocking call to walk with args (PosixPath('/config/blueprints/switch_manager'),) inside the event loop by custom integration 'switch_manager' at custom_components/switch_manager/helpers.py, line 48: for f in _find_files(folder, ".yaml"): (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 377: for root, dirs, files in os.walk(directory, topdown=True):), please create a bug report at https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk 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 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/src/homeassistant/homeassistant/setup.py", line 167, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component result = await task File "/config/custom_components/switch_manager/init.py", line 61, in async_setup await _init_blueprints(hass) File "/config/custom_components/switch_manager/init.py", line 89, in _init_blueprints for config in await load_blueprints(hass): File "/config/custom_components/switch_manager/helpers.py", line 48, in load_blueprints for f in _find_files(folder, ".yaml"): Detected blocking call to scandir with args ('/config/blueprints/switch_manager',) inside the event loop by custom integration 'switch_manager' at custom_components/switch_manager/helpers.py, line 48: for f in _find_files(folder, ".yaml"): (offender: , line 366: ?), please create a bug report at https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir 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 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/src/homeassistant/homeassistant/setup.py", line 167, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component result = await task File "/config/custom_components/switch_manager/init.py", line 61, in async_setup await _init_blueprints(hass) File "/config/custom_components/switch_manager/init.py", line 89, in _init_blueprints for config in await load_blueprints(hass): File "/config/custom_components/switch_manager/helpers.py", line 48, in load_blueprints for f in _find_files(folder, ".yaml"):`

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

Bascht74 commented 2 months ago

I get the same log entry:

Detected blocking call to walk with args (PosixPath('/config/blueprints/switch_manager'),) inside the event loop by custom integration 'switch_manager' at custom_components/switch_manager/helpers.py, line 48: for f in _find_files(folder, ".yaml"): (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 377: for root, dirs, files in os.walk(directory, topdown=True):), please create a bug report at https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk 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 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/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 416, in _async_setup_component result = await task File "/config/custom_components/switch_manager/init.py", line 61, in async_setup await _init_blueprints(hass) File "/config/custom_components/switch_manager/init.py", line 89, in _init_blueprints for config in await load_blueprints(hass): File "/config/custom_components/switch_manager/helpers.py", line 48, in load_blueprints for f in _find_files(folder, ".yaml"): Detected blocking call to scandir with args ('/config/blueprints/switch_manager',) inside the event loop by custom integration 'switch_manager' at custom_components/switch_manager/helpers.py, line 48: for f in _find_files(folder, ".yaml"): (offender: , line 366: ?), please create a bug report at https://github.com/Sian-Lee-SA/Home-Assistant-Switch-Manager/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir 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 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/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 416, in _async_setup_component result = await task File "/config/custom_components/switch_manager/init.py", line 61, in async_setup await _init_blueprints(hass) File "/config/custom_components/switch_manager/init.py", line 89, in _init_blueprints for config in await load_blueprints(hass): File "/config/custom_components/switch_manager/helpers.py", line 48, in load_blueprints for f in _find_files(folder, ".yaml"):

Sian-Lee-SA commented 1 month ago

Closing as fixed in latest release