jdejaegh / irm-kmi-ha

Home Assistant weather provider using data from Belgian IRM KMI 🇧🇪 🇱🇺 🇳🇱
MIT License
40 stars 0 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'custom_components/irm_kmi/resources/roboto_medium.ttf' #13

Closed COTMO closed 5 months ago

COTMO commented 5 months ago

Get the debug logs: go to Settings > Devices & services > IRM KMI integration > Disable debug logging. Download the file and attach it here. home-assistant_irm_kmi_2024-03-24T12-32-13.602Z.log

Describe the bug FileNotFoundError: [Errno 2] No such file or directory: 'custom_components/irm_kmi/resources/roboto_medium.ttf'

Version

jdejaegh commented 5 months ago

Thanks for reporting this issue.

I tried to reproduce it using the information provided. However, I cannot replicate the behavior shown in the logs.

Here are the steps I took to reproduce:

  1. Fresh install Home Assistant using Docker (version 2024.3.3)
  2. Install HACS
  3. Install the integration using HACS (version 0.2.3)
  4. Add the weather for Brussels
  5. Expect the error to happen (not happening)

From the logs, I see that the integration is missing the font file roboto_medium.ttf. This is strange as it is part of the repository and should be download as any other file of the integration when installing it.

Could you consider the following:

  1. Try re-installing the integration
  2. Explain how you install the integration (HACS or manually)
  3. Check in {HA install location}/config/custom_components/irm_kmi/resources if you have the file roboto_medium.ttf

Thanks for your feedback

COTMO commented 5 months ago

I installed via HACS. The weird thing is the file is there. But still not working.

image
jdejaegh commented 5 months ago

Weird, indeed. Did you try removing and re-installing the integration?

COTMO commented 5 months ago

I removed it completely and then reinstalled via HACS.

jdejaegh commented 5 months ago

I implemented another way to load the font that does not require loading the file. It may solve this issue but I fear that there is a more general issue with your config and that the other resources won't load either (like the map background). This is available in the newly release version 0.2.4 (you may have to force re-download on HACS to have the new version show immediately).

COTMO commented 5 months ago

Its like you feared other items won't load now.

jdejaegh commented 5 months ago

Not surprising actually. It looks like the working directory is not in config in your case.

Did the integration ever worked before in your setup? How do you run Home Assistant? Docker (which image), Supervisor, other?

I am not sure that the issue is really linked to the integration itself

jdejaegh commented 5 months ago

I think I figured it out: when loading files, I assumed that the current working directory is the config directory. In version 0.2.5, I use the Home Assistant configuration object to know where the config directory really is.

Version 0.2.5 should solve this issue.

@COTMO Could you try and tell me if it works for you?

COTMO commented 5 months ago

@jdejaegh Now it works fine. Thanks you for fixing it :)