hacs-govee
hacs-govee copied to clipboard
This integration is doing blocking SSL verification and file reads inside the event loop, causing loop warnings under Python 3.13 and Home Assistant 2024.X
Version of the custom_component
2025.1.1
Configuration
Add your logs here.
Logger: homeassistant.util.loop
Source: util/loop.py:137
First occurred: 9:21:30 PM (2 occurrences)
Last logged: 9:21:31 PM
Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f4f75084560>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'govee' at custom_components/govee/__init__.py, line 53: hub = await Govee.create( (offender: /usr/local/lib/python3.13/ssl.py, line 717: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/LaggAt/hacs-govee/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations 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 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 471, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 473, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/govee/__init__.py", line 53, in async_setup_entry hub = await Govee.create(
Detected blocking call to open with args ('/config/govee_learning.yaml',) inside the event loop by custom integration 'govee' at custom_components/govee/learning_storage.py, line 28: learned_dict = load_yaml(self._config_dir + LEARNING_STORAGE_YAML) (offender: /usr/local/lib/python3.13/site-packages/annotatedyaml/loader.py, line 166: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/LaggAt/hacs-govee/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 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/govee/__init__.py", line 64, in async_setup_entry _, err = await hub.get_devices() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/govee_api_laggat.py", line 312, in get_devices _, err_api = await self._api.get_devices() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/api.py", line 244, in get_devices learning_infos = await self._govee._learning_storage._read_cached() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/learning_storage.py", line 30, in _read_cached self._learned_info = await self.read() File "/config/custom_components/govee/learning_storage.py", line 28, in read learned_dict = load_yaml(self._config_dir + LEARNING_STORAGE_YAML)
Describe the bug
A clear and concise description of what the bug is.
This integration is doing blocking SSL verification and file reads inside the event loop, causing loop warnings under Python 3.13 and Home Assistant 2024.XX.
Debug log
Logger: homeassistant.util.loop
Source: util/loop.py:137
First occurred: 9:21:30 PM (2 occurrences)
Last logged: 9:21:31 PM
Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f4f75084560>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', None, None) inside the event loop by custom integration 'govee' at custom_components/govee/__init__.py, line 53: hub = await Govee.create( (offender: /usr/local/lib/python3.13/ssl.py, line 717: context.load_verify_locations(cafile, capath, cadata)), please create a bug report at https://github.com/LaggAt/hacs-govee/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_verify_locations 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 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 171, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 471, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 473, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/govee/__init__.py", line 53, in async_setup_entry hub = await Govee.create(
Detected blocking call to open with args ('/config/govee_learning.yaml',) inside the event loop by custom integration 'govee' at custom_components/govee/learning_storage.py, line 28: learned_dict = load_yaml(self._config_dir + LEARNING_STORAGE_YAML) (offender: /usr/local/lib/python3.13/site-packages/annotatedyaml/loader.py, line 166: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/LaggAt/hacs-govee/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 227, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 706, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 677, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2034, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 894, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 660, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/govee/__init__.py", line 64, in async_setup_entry _, err = await hub.get_devices() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/govee_api_laggat.py", line 312, in get_devices _, err_api = await self._api.get_devices() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/api.py", line 244, in get_devices learning_infos = await self._govee._learning_storage._read_cached() File "/usr/local/lib/python3.13/site-packages/govee_api_laggat/learning_storage.py", line 30, in _read_cached self._learned_info = await self.read() File "/config/custom_components/govee/learning_storage.py", line 28, in read learned_dict = load_yaml(self._config_dir + LEARNING_STORAGE_YAML)