jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
https://jeroenterheerdt.github.io/HAsmartirrigation/
MIT License
347 stars 49 forks source link

register_static_path is deprecated because it does blocking I/O in the event loop #429

Open clau-bucur opened 2 months ago

clau-bucur commented 2 months ago

What happened?

Upon start, HA logs the following warning:

WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'smart_irrigation' calls hass.http.register_static_path which is deprecated because it does blocking I/O in the event loop, instead call `await hass.http.async_register_static_paths([StaticPathConfig("/api/panel_custom/smart-irrigation", "/config/custom_components/smart_irrigation/frontend/dist/smart-irrigation.js", False)])`; This function will be removed in 2025.7 at custom_components/smart_irrigation/panel.py, line 32: hass.http.register_static_path(PANEL_URL, view_url, False), please create a bug report at https://github.com/jeroenterheerdt/HASmartIrrigation/issues

How to reproduce

Just restart HA.

Diagnostics file: config_entry-smart_irrigation-54a29ef14b286103055503f5030ddb5a.json

Relevant log output

No response

Which version are you running?

2024.7.4

Diagnostics file

Additional information

No response

jeroenterheerdt commented 2 months ago

thanks - I noticed this too but it seems like it's a bit too early to move to this other function as I ran into compat issues.