KartoffelToby / better_thermostat

This custom component for Home Assistant will add crucial features to your climate-controlling TRV (Thermostatic Radiator Valves) to save you the work of creating automations to make it smart. It combines a room-temperature sensor, window/door sensors, weather forecasts, or an ambient temperature probe to decide when it should call for heat and automatically calibrate your TRVs to fix the imprecise measurements taken in the radiator's vicinity.
https://better-thermostat.org
GNU Affero General Public License v3.0
762 stars 122 forks source link

Detected blocking call to import_module with args ('custom_components.better_thermostat.adapters.zha',) #1385

Open vordenken opened 3 weeks ago

vordenken commented 3 weeks ago

Prerequisites

{
Logger: homeassistant.util.loop
Quelle: util/loop.py:136
Erstmals aufgetreten: 09:35:05 (4 Vorkommnisse)
Zuletzt protokolliert: 09:58:23

Detected blocking call to import_module with args ('custom_components.better_thermostat.adapters.zha',) inside the event loop by custom integration 'better_thermostat' at custom_components/better_thermostat/adapters/delegate.py, line 16: self.adapter = import_module( (offender: /config/custom_components/better_thermostat/adapters/delegate.py, line 16: self.adapter = import_module(), please create a bug report at https://github.com/KartoffelToby/better_thermostat/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module 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 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/config_entries.py", line 752, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/better_thermostat/__init__.py", line 35, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2098, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2109, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2111, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2191, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 226, in async_setup_entry return await component.async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 195, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 331, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform awaitable = create_eager_task(awaitable, loop=hass.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/better_thermostat/climate.py", line 135, in async_setup_entry async_add_devices( File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 513, in _async_schedule_add_entities_for_entry task = self.config_entry.async_create_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1152, in async_create_task task = hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 647, in async_add_entities await add_func(coros, entities, timeout) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/better_thermostat/climate.py", line 338, in async_added_to_hass _adapter = load_adapter(self, trv["integration"], trv["trv"]) File "/config/custom_components/better_thermostat/adapters/delegate.py", line 16, in load_adapter self.adapter = import_module(
Detected blocking call to import_module with args ('custom_components.better_thermostat.adapters.generic',) inside the event loop by custom integration 'better_thermostat' at custom_components/better_thermostat/adapters/delegate.py, line 27: self.adapter = import_module( (offender: /config/custom_components/better_thermostat/adapters/delegate.py, line 27: self.adapter = import_module(), please create a bug report at https://github.com/KartoffelToby/better_thermostat/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module 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 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/config_entries.py", line 752, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/better_thermostat/__init__.py", line 35, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2098, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2109, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2111, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2191, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 226, in async_setup_entry return await component.async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 195, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 331, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform awaitable = create_eager_task(awaitable, loop=hass.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/better_thermostat/climate.py", line 135, in async_setup_entry async_add_devices( File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 513, in _async_schedule_add_entities_for_entry task = self.config_entry.async_create_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1152, in async_create_task task = hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 647, in async_add_entities await add_func(coros, entities, timeout) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/better_thermostat/climate.py", line 338, in async_added_to_hass _adapter = load_adapter(self, trv["integration"], trv["trv"]) File "/config/custom_components/better_thermostat/adapters/delegate.py", line 27, in load_adapter self.adapter = import_module(
Detected blocking call to import_module with args ('custom_components.better_thermostat.model_fixes.TS0601',) inside the event loop by custom integration 'better_thermostat' at custom_components/better_thermostat/model_fixes/model_quirks.py, line 14: self.model_quirks = import_module( (offender: /config/custom_components/better_thermostat/model_fixes/model_quirks.py, line 14: self.model_quirks = import_module(), please create a bug report at https://github.com/KartoffelToby/better_thermostat/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module 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 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/config_entries.py", line 752, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/better_thermostat/__init__.py", line 35, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2098, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2109, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2111, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2191, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 226, in async_setup_entry return await component.async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 195, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 331, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform awaitable = create_eager_task(awaitable, loop=hass.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/config/custom_components/better_thermostat/climate.py", line 135, in async_setup_entry async_add_devices( File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 513, in _async_schedule_add_entities_for_entry task = self.config_entry.async_create_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1152, in async_create_task task = hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 830, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 647, in async_add_entities await add_func(coros, entities, timeout) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 598, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 912, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/better_thermostat/climate.py", line 339, in async_added_to_hass _model_quirks = load_model_quirks(self, trv["model"], trv["trv"]) File "/config/custom_components/better_thermostat/model_fixes/model_quirks.py", line 14, in load_model_quirks self.model_quirks = import_module(
Detected blocking call to listdir with args ('/config/deps/lib/python3.12/site-packages',) inside the event loop by integration 'zha' at homeassistant/components/zha/diagnostics.py, line 89: "bellows": version("bellows"), (offender: /usr/local/lib/python3.12/importlib/metadata/__init__.py, line 680: return os.listdir(self.root or '.')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+zha%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir 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 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/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 280, in get data = await info.config_entry_diagnostics(hass, config_entry) File "/usr/src/homeassistant/homeassistant/components/zha/diagnostics.py", line 89, in async_get_config_entry_diagnostics "bellows": version("bellows"),
}

Description

Steps to Reproduce

Expected behavior:

Actual behavior:

Versions

HA 2024.8.3 BT 1.6.0

Additional Information

This is a warning I get...

attisz123 commented 2 weeks ago

I have exactly same issue.

JulesCyb commented 4 days ago

I have the same issue, on Home Assistant Core (current version as of day of posting):

Detected blocking call to import_module with args ('custom_components.better_thermostat.adapters.mqtt',) inside the event loop by custom integration 'better_thermostat' at custom_components/better_thermostat/adapters/delegate.py, line 16: self.adapter = import_module( (offender: /config/custom_components/better_thermostat/adapters/delegate.py, line 16: self.adapter = import_module(), please create a bug report at https://github.com/KartoffelToby/better_thermostat/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module 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 "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/better_thermostat/init.py", line 35, in async_setup_entry await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2121, in async_forward_entry_setups await self._async_forward_entry_setups_locked(entry, platforms) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2132, in _async_forward_entry_setups_locked await asyncio.gather( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2134, in create_eagertask( 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 2214, in _async_forward_entry_setup await entry.async_setup(self.hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/climate/init.py", line 226, in async_setup_entry return await component.async_setup_entry(entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in async_setup_entry return await self._platforms[key].async_setup_entry(config_entry) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 328, in async_setup_entry return await self._async_setup_platform(async_create_setup_awaitable) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_setup_platform awaitable = create_eagertask(awaitable, loop=hass.loop) 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 "/config/custom_components/better_thermostat/climate.py", line 135, in async_setup_entry async_add_devices( File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 510, in _async_schedule_add_entities_for_entry task = self.config_entry.async_create_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1152, in async_create_task task = hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 829, in async_create_task_internal task = create_eagertask(target, name=name, loop=self.loop) 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/helpers/entity_platform.py", line 644, in async_add_entities await add_func(coros, entities, timeout) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 595, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1365, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/better_thermostat/climate.py", line 338, in async_added_to_hass _adapter = load_adapter(self, trv["integration"], trv["trv"]) File "/config/custom_components/better_thermostat/adapters/delegate.py", line 16, in load_adapter self.adapter = import_module(

marwonn commented 4 days ago

Same here.

Picknickz commented 8 hours ago

Samen here too