IATkachenko / HA-YandexWeather

Yandex weather intergration for Home Assistant
Apache License 2.0
200 stars 12 forks source link

Detected blocking call to open inside the event loop by custom integration 'yandex_weather' at custom_components/yandex_weather/updater.py #120

Open EvgenyBash opened 3 months ago

EvgenyBash commented 3 months ago

The problem

В логах появляются такие ошибки

What version of the integration has the issue?

3.2.5

What version of Home Assistant Core has the issue?

core-2024.6.1

What type of installation are you running?

Home Assistant OS

Anything in the logs that might be useful for us?

Регистратор: homeassistant.util.loop
Источник: util/loop.py:84
Первое сообщение: 20:03:55 (1 сообщений)
Последнее сообщение: 20:03:55

Detected blocking call to open inside the event loop by custom integration 'yandex_weather' at custom_components/yandex_weather/updater.py, line 137: with open(_translation_location) as f: (offender: /config/custom_components/yandex_weather/updater.py, line 137: with open(_translation_location) as f:), please create a bug report at https://github.com/IATkachenko/HA-YandexWeather/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 "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 268, in _async_update_data return await self.update_method() 
File "/config/custom_components/yandex_weather/updater.py", line 260, in update self.process_data(result, r["fact"], CURRENT_WEATHER_ATTRIBUTE_TRANSLATION) 
File "/config/custom_components/yandex_weather/updater.py", line 211, in process_data value = translate_condition( 
File "/config/custom_components/yandex_weather/updater.py", line 137, in translate_condition with open(_translation_location) as f:

Additional information

No response

IATkachenko commented 3 months ago

Кажется это ничего не ломает, а просто нам рассказывают что хотят больше асинхронных вызовов.

Посмотрю как улучшить.

EvgenyBash commented 3 months ago

Кажется это ничего не ломает,

Да, интеграция работает, просто в логах валится эта инфа.

IATkachenko commented 3 months ago

Со временем поправлю, если Яндекс совсем публичный бесплатный доступ к API не закроет...