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

Warning on HA 2024.6.0 #196

Closed
4 tasks done
to4ko opened this issue Jun 6, 2024 · 3 comments · May be fixed by #200
Closed
4 tasks done

Warning on HA 2024.6.0 #196

to4ko opened this issue Jun 6, 2024 · 3 comments · May be fixed by #200
Labels
bug Something isn't working.

Comments

@to4ko
Copy link

to4ko commented Jun 6, 2024

System Health details

System Information

version core-2024.6.0
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.1.0-21-amd64
arch x86_64
timezone Europe/Moscow
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web pending
GitHub API Calls Remaining 4976
Installed Version 1.34.0
Stage running
Available Repositories 1479
Downloaded Repositories 25
Home Assistant Supervisor
host_os Debian GNU/Linux 12 (bookworm)
update_channel stable
supervisor_version supervisor-2024.06.0
agent_version 1.6.0
docker_version 26.1.3
disk_total 61.8 GB
disk_used 39.5 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
supervisor_api ok
version_api pending
installed_addons File editor (5.8.0), RPC Shutdown (2.5), Log Viewer (0.17.0), Home Assistant Google Drive Backup (0.112.1), Grafana (10.0.0), MariaDB (2.7.1), Nginx Proxy Manager (1.0.1), chrony (3.0.1), Samba Backup (5.2.0), Terminal & SSH (9.14.0), Studio Code Server (5.15.0), Uptime Kuma (0.12.1), Portainer (2.20.1), go2rtc (1.9.3), Advanced SSH & Web Terminal (18.0.0), MQTT Explorer (browser-1.0.1), Samba share (12.3.1), Mosquitto broker (6.4.1), ESPHome (2024.5.5), Matter Server (6.1.0), phpMyAdmin (0.9.1), Portainer Agent (linux-ppc64le-2.20.3-alpine), AppDaemon (0.16.6), DbStats (0.5.8), Firefox (1.2.0), Good-Old IDE (0.0.7)
Dashboards
dashboards 7
resources 11
views 30
mode yaml
Recorder
oldest_recorder_run June 5, 2024 at 19:18
current_recorder_run June 5, 2024 at 22:18
estimated_db_size 2015.95 MiB
database_engine mysql
database_version 10.11.6

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

After HA updated to latest release 2024.6.0 warning shows below appeared in log. Integration version 3.0.0

Logger: homeassistant.util.loop
Source: util/loop.py:84
First occurred: June 5, 2024 at 22:19:03 (324 occurrences)
Last logged: 21:05:12

Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data await self.gismeteo.async_update() File "/config/custom_components/gismeteo/api.py", line 631, in async_update response = await self.async_get_forecast() File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast return await self._async_get_data(url, cache_fname) File "/config/custom_components/gismeteo/api.py", line 223, in _async_get_data self._cache.save_cache(cache_fname, data) File "/config/custom_components/gismeteo/cache.py", line 95, in save_cache with open(file_path, "w", encoding="utf-8") as fp:
Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval self.config_entry.async_create_background_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1164, in async_create_background_task task = hass.async_create_background_task(target, name, eager_start) File "/usr/src/homeassistant/homeassistant/core.py", line 860, in async_create_background_task 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/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data await self.gismeteo.async_update() File "/config/custom_components/gismeteo/api.py", line 631, in async_update response = await self.async_get_forecast() File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast return await self._async_get_data(url, cache_fname) File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data return self._cache.read_cache(cache_fname) File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache with open(file_path, encoding="utf-8") as fp:
Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval self.config_entry.async_create_background_task( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1164, in async_create_background_task task = hass.async_create_background_task(target, name, eager_start) File "/usr/src/homeassistant/homeassistant/core.py", line 860, in async_create_background_task 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/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data await self.gismeteo.async_update() File "/config/custom_components/gismeteo/api.py", line 639, in async_update await self.async_update_parsed() File "/config/custom_components/gismeteo/api.py", line 624, in async_update_parsed self._parsed = await self.async_get_parsed() File "/config/custom_components/gismeteo/api.py", line 271, in async_get_parsed forecast = await self.async_get_forecast() File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast return await self._async_get_data(url, cache_fname) File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data return self._cache.read_cache(cache_fname) File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache with open(file_path, encoding="utf-8") as fp:
Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data await self.gismeteo.async_update() File "/config/custom_components/gismeteo/api.py", line 639, in async_update await self.async_update_parsed() File "/config/custom_components/gismeteo/api.py", line 624, in async_update_parsed self._parsed = await self.async_get_parsed() File "/config/custom_components/gismeteo/api.py", line 281, in async_get_parsed response = await self._async_get_data(url, cache_fname, as_browser=True) File "/config/custom_components/gismeteo/api.py", line 223, in _async_get_data self._cache.save_cache(cache_fname, data) File "/config/custom_components/gismeteo/cache.py", line 95, in save_cache with open(file_path, "w", encoding="utf-8") as fp:
Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data await self.gismeteo.async_update() File "/config/custom_components/gismeteo/api.py", line 639, in async_update await self.async_update_parsed() File "/config/custom_components/gismeteo/api.py", line 624, in async_update_parsed self._parsed = await self.async_get_parsed() File "/config/custom_components/gismeteo/api.py", line 271, in async_get_parsed forecast = await self.async_get_forecast() File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast return await self._async_get_data(url, cache_fname) File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data return self._cache.read_cache(cache_fname) File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache with open(file_path, encoding="utf-8") as fp:

Reproduction steps

  1. update HA to 2024.6.0

Debug logs

2024-06-06 21:05:12.570 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval
    self.config_entry.async_create_background_task(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1164, in async_create_background_task
    task = hass.async_create_background_task(target, name, eager_start)
  File "/usr/src/homeassistant/homeassistant/core.py", line 860, in async_create_background_task
    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/update_coordinator.py", line 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data
    await self.gismeteo.async_update()
  File "/config/custom_components/gismeteo/api.py", line 631, in async_update
    response = await self.async_get_forecast()
  File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast
    return await self._async_get_data(url, cache_fname)
  File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data
    return self._cache.read_cache(cache_fname)
  File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache
    with open(file_path, encoding="utf-8") as fp:

2024-06-06 21:05:12.575 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 239, in __wrap_handle_refresh_interval
    self.config_entry.async_create_background_task(
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1164, in async_create_background_task
    task = hass.async_create_background_task(target, name, eager_start)
  File "/usr/src/homeassistant/homeassistant/core.py", line 860, in async_create_background_task
    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/update_coordinator.py", line 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data
    await self.gismeteo.async_update()
  File "/config/custom_components/gismeteo/api.py", line 639, in async_update
    await self.async_update_parsed()
  File "/config/custom_components/gismeteo/api.py", line 624, in async_update_parsed
    self._parsed = await self.async_get_parsed()
  File "/config/custom_components/gismeteo/api.py", line 271, in async_get_parsed
    forecast = await self.async_get_forecast()
  File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast
    return await self._async_get_data(url, cache_fname)
  File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data
    return self._cache.read_cache(cache_fname)
  File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache
    with open(file_path, encoding="utf-8") as fp:

2024-06-06 21:05:12.580 INFO (MainThread) [homeassistant.components.automation.system_triggered_automations_counter] system_triggered_automations_counter: Running automation actions
2024-06-06 21:05:12.580 INFO (MainThread) [homeassistant.components.automation.system_triggered_automations_counter] system_triggered_automations_counter: Executing step call service
2024-06-06 21:05:12.584 INFO (MainThread) [homeassistant.components.automation.system_warning_counter] system_warning_counter: Running automation actions
2024-06-06 21:05:12.584 INFO (MainThread) [homeassistant.components.automation.system_warning_counter] system_warning_counter: Executing step call service
2024-06-06 21:05:12.588 INFO (MainThread) [homeassistant.components.automation.system_triggered_automations_counter] system_triggered_automations_counter: Running automation actions
2024-06-06 21:05:12.588 INFO (MainThread) [homeassistant.components.automation.system_triggered_automations_counter] system_triggered_automations_counter: Executing step call service
2024-06-06 21:05:12.590 INFO (MainThread) [homeassistant.components.automation.system_warning_counter] system_warning_counter: Running automation actions
2024-06-06 21:05:12.590 INFO (MainThread) [homeassistant.components.automation.system_warning_counter] system_warning_counter: Executing step call service
2024-06-06 21:05:12.745 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 95: with open(file_path, "w", encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/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/helpers/update_coordinator.py", line 255, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/gismeteo/__init__.py", line 202, in _async_update_data
    await self.gismeteo.async_update()
  File "/config/custom_components/gismeteo/api.py", line 639, in async_update
    await self.async_update_parsed()
  File "/config/custom_components/gismeteo/api.py", line 624, in async_update_parsed
    self._parsed = await self.async_get_parsed()
  File "/config/custom_components/gismeteo/api.py", line 281, in async_get_parsed
    response = await self._async_get_data(url, cache_fname, as_browser=True)
  File "/config/custom_components/gismeteo/api.py", line 223, in _async_get_data
    self._cache.save_cache(cache_fname, data)
  File "/config/custom_components/gismeteo/cache.py", line 95, in save_cache
    with open(file_path, "w", encoding="utf-8") as fp:


### Diagnostics dump

_No response_
@to4ko to4ko added the bug Something isn't working. label Jun 6, 2024
@f1lint
Copy link

f1lint commented Jun 17, 2024

same issue

@positiveviking
Copy link

Let me suggest use aiofiles and make Cache methods async

@positiveviking positiveviking mentioned this issue Jun 28, 2024
9 tasks
@vtimer
Copy link

vtimer commented Jul 31, 2024

ive got similar warning
024-07-30 19:34:21.184 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/config/.storage/gismeteo.forecast_296856.xml',) inside the event loop by custom integration 'gismeteo' at custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp: (offender: /config/custom_components/gismeteo/cache.py, line 83: with open(file_path, encoding="utf-8") as fp:), please create a bug report at https://github.com/Limych/ha-gismeteo/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
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 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 734, in async_setup_locked
await self.async_setup(hass, integration=integration)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/gismeteo/init.py", line 152, in async_setup_entry
coordinator = await _async_get_coordinator(hass, entry.entry_id, config)
File "/config/custom_components/gismeteo/init.py", line 124, in _async_get_coordinator
await coordinator.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 288, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/gismeteo/init.py", line 202, in _async_update_data
await self.gismeteo.async_update()
File "/config/custom_components/gismeteo/api.py", line 631, in async_update
response = await self.async_get_forecast()
File "/config/custom_components/gismeteo/api.py", line 267, in async_get_forecast
return await self._async_get_data(url, cache_fname)
File "/config/custom_components/gismeteo/api.py", line 210, in _async_get_data
return self._cache.read_cache(cache_fname)
File "/config/custom_components/gismeteo/cache.py", line 83, in read_cache
with open(file_path, encoding="utf-8") as fp:

Limych added a commit that referenced this issue Oct 5, 2024
…eq-3.8

Update pre-commit requirement from ~=3.7 to ~=3.8
@Limych Limych closed this as completed in c8aaafa Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants