thomasloven / hass-fontawesome

🔹 Use icons from fontawesome in home-assistant
Other
274 stars 52 forks source link

Fix IO blocking caused by static path & os.walk #87

Open RobertD502 opened 2 months ago

RobertD502 commented 2 months ago

Static Path

Registering View

Walk I/O blocking

The OS walk function does blocking disk I/O and users will get warnings about this. To get around this, we can use hass.async_add_executor_job to call it. However, this doesn't fully solve the problem since walk also calls scandir within itself, resulting in Home Assistant complaining about blocking still occurring. To get around this, I have added a get_icons_list helper function which is run in the executor instead of directly calling walk in the executor.

Associated Issues