greghesp / ha-bambulab

A Home Assistant Integration for Bambu Lab Printers
913 stars 73 forks source link

[Bug] HA warning about blocking call inside event loop #619

Closed AdrianGarside closed 4 hours ago

AdrianGarside commented 4 hours ago

Describe the bug

2024-10-22 09:16:43.359 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7f565a68cc50>,) inside the event loop by custom integration 'bambu_lab' at custom_components/bambu_lab/pybambu/bambu_client.py, line 332: self.client.tls_set(tls_version=ssl.PROTOCOL_TLS, cert_reqs=ssl.CERT_NONE) (offender: /usr/local/lib/python3.12/site-packages/paho/mqtt/client.py, line 806: context.load_default_certs()), please create a bug report at https://github.com/greghesp/ha-bambulab/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs 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 189, 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 "/config/custom_components/bambu_lab/coordinator.py", line 131, in listen self.client.connect(callback=self.event_handler) File "/config/custom_components/bambu_lab/pybambu/bambu_client.py", line 332, in connect self.client.tls_set(tls_version=ssl.PROTOCOL_TLS, cert_reqs=ssl.CERT_NONE)

To Reproduce

.

Expected Behaviour

.

What device are you using?

P1S

Diagnostic Output

.

Log Extracts

No response

Other Information

No response

AdrianGarside commented 4 hours ago

Dupe of #586