Hi 👋
I’m seeing two warnings from Home Assistant related to blocking calls made inside the event loop by the govee custom integration. These calls violate Home Assistant’s asyncio rules and could cause performance issues.
⸻
🧪 System Information
• Home Assistant Core Version: 2025.7.0
• Python Version: 3.13
• Installation Type: Docker (Synology)
• Govee Integration: Installed via HACS
• Custom Component Path: /config/custom_components/govee/
🐞 Detected Issues
-
Blocking call: load_verify_locations()
Detected blocking call to load_verify_locations with args (<ssl.SSLContext object ...>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', ...)
inside the event loop by custom integration 'govee' at custom_components/govee/init.py, line 53:
hub = await Govee.create(...)
-
Blocking call: open('/config/govee_learning.yaml')
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)
🔁 Expected Behavior
These operations should be moved out of the event loop and executed using non-blocking techniques (e.g., asyncio.to_thread() or homeassistant.util.async_.run_blocking_io()).
Reference:
👉 https://developers.home-assistant.io/docs/asyncio_blocking_operations/
⸻
🙏 Suggestion
Please refactor the integration to avoid direct blocking calls inside async functions. It would help prevent log spam and improve performance for users.
Hi 👋
I’m seeing two warnings from Home Assistant related to blocking calls made inside the event loop by the govee custom integration. These calls violate Home Assistant’s asyncio rules and could cause performance issues.
⸻
🧪 System Information
• Home Assistant Core Version: 2025.7.0
• Python Version: 3.13
• Installation Type: Docker (Synology)
• Govee Integration: Installed via HACS
• Custom Component Path: /config/custom_components/govee/
🐞 Detected Issues
Blocking call: load_verify_locations()
Detected blocking call to load_verify_locations with args (<ssl.SSLContext object ...>, '/usr/local/lib/python3.13/site-packages/certifi/cacert.pem', ...)
inside the event loop by custom integration 'govee' at custom_components/govee/init.py, line 53:
hub = await Govee.create(...)
Blocking call: open('/config/govee_learning.yaml')
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)
🔁 Expected Behavior
These operations should be moved out of the event loop and executed using non-blocking techniques (e.g., asyncio.to_thread() or homeassistant.util.async_.run_blocking_io()).
Reference:
👉 https://developers.home-assistant.io/docs/asyncio_blocking_operations/
⸻
🙏 Suggestion
Please refactor the integration to avoid direct blocking calls inside async functions. It would help prevent log spam and improve performance for users.