Weather Widget - Side, Top and Block

Hi everyone! I’ve been working on a new Weather Widget for OpenHAB, and I wanted to share my progress and ask for some help with a specific issue I’m facing.

The widget is designed to display weather information in three different layouts: Side, Top, and Block. It’s been a fun project, and I’ve managed to get most of the features working smoothly. I’ve also integrated multiple weather icon sets, which allows users to switch between different visual styles based on their preference.

One thing I’m struggling with, however, is the configuration of weather units. I’ve set up the widget to support both Celsius and Fahrenheit, but I’m having trouble getting the widget to display the correct temperature based on the user’s selected unit. Specifically, the widget isn’t reading the unit setting correctly when it initializes, which means it defaults to the wrong unit.

I’ve tried a few different approaches, including using scripts to lazy load the settings, but it seems like the script is running before the HabPanel updates the settings with the proper values. This results in the widget displaying {{config.units}} instead of the actual unit value. I’ve also tried using the setting as a CLASS or VALUE, but neither approach has worked so far.

If anyone has experience with similar issues or knows how to ensure the widget reads the updated settings after initialization, I’d greatly appreciate your advice! I’ve included a link to my GitHub repository where you can find the widget’s code and some instructions for downloading and renaming the weather icons.

Thanks in advance for your help! Let’s make this widget even better together! :sun_with_face::sunny: