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

HA 2026.1 & FR 1.14.1 | [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'flightradar24' at custom_components/flightradar24/coordinator.py, line 240 #44

Closed
AnthonyBe opened this issue Jun 8, 2024 · 1 comment

Comments

@AnthonyBe
Copy link

AnthonyBe commented Jun 8, 2024

I just updated from HA 2024.5.5 to 2024.6.1 and am now getting the following error.
I have v1.14.1 of the FlightRadar24 integration.
Just for reference, a number of other integrations I use are encountering the same issue, e.g. Tuya-Local (make-all/tuya-local#1981) and TheWatchman (dummylabs/thewatchman#135) with HA 2024.6

2024-06-08 13:35:17.793 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'flightradar24' at custom_components/flightradar24/coordinator.py, line 240: country = pycountry.countries.get(alpha_3=code) (offender: /usr/local/lib/python3.12/site-packages/pycountry/db.py, line 103: with open(self.filename, encoding="utf-8") as f:), please create a bug report at https://github.com/AlexandrErohin/home-assistant-flightradar24/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/flightradar24/coordinator.py", line 109, in _async_update_data
    await self._update_flights_in_area()
  File "/config/custom_components/flightradar24/coordinator.py", line 125, in _update_flights_in_area
    await self._update_flights_data(obj, current, self.in_area, SensorType.IN_AREA)
  File "/config/custom_components/flightradar24/coordinator.py", line 187, in _update_flights_data
    flight = self._get_flight_data(data)
  File "/config/custom_components/flightradar24/coordinator.py", line 267, in _get_flight_data
    'airport_origin_country_code': _get_country_code(
  File "/config/custom_components/flightradar24/coordinator.py", line 240, in _get_country_code
    country = pycountry.countries.get(alpha_3=code)

@AlexandrErohin
Copy link
Owner

@AnthonyBe Thank you!
It is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants