Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration fails with blocking call warnings on HA v2024.6.2 #135

Closed
goofball222 opened this issue Jun 13, 2024 · 1 comment
Closed

Integration fails with blocking call warnings on HA v2024.6.2 #135

goofball222 opened this issue Jun 13, 2024 · 1 comment

Comments

@goofball222
Copy link

Repeated errors in the HA logs after presence simulation is triggered either via switch or automation. No lights are being controlled as far as I can tell.

2024-06-12 11:04:34.489 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'presence_simulation' at custom_components/presence_simulation/__init__.py, line 187: await entity.set_start_datetime(datetime.now(pytz.timezone(hass.config.time_zone))) (offender: /usr/local/lib/python3.12/site-packages/pytz/__init__.py, line 108: return open(filename, 'rb')), please create a bug report at https://github.com/slashback100/presence_simulation/issues

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 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/core.py", line 2761, in _run_service_call_catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 2784, in _execute_service return await target(service_call) File "/config/custom_components/presence_simulation/__init__.py", line 187, in handle_presence_simulation await entity.set_start_datetime(datetime.now(pytz.timezone(hass.config.time_zone)))

@bjw-s
Copy link
Contributor

bjw-s commented Jul 5, 2024

I'm not typically one for leaving +1's, but unfortunately I'm seeing the same issue :(

I've submitted what might be a fix to get the ball rolling but my Python asyncio knowledge isn't great so I may be going about it all wrong. It does make the error go away, and my configured lights seem to be properly controlled by the integration again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants