willasm / obsidian-open-weather

Obsidian plugin for OpenWeather API
MIT License
44 stars 2 forks source link

Missing rain data #4

Closed Trusku closed 1 year ago

Trusku commented 1 year ago

Hello, I have a request if possible. Could it be viable to include rain or precipitation in the queries of the plugin? I have been missing this data, but apart from that I have found the plugin very useful. Thanks for your work! Waiting for your comments, thanks in advance.

willasm commented 1 year ago

Great suggestion. Been meaning to add that for a while. Starting on it now and hopefully should have an update by tomorrow.

Trusku commented 1 year ago

Thanks for your early reply! Will be waiting for the update, many thanks!

willasm commented 1 year ago

Just uploaded an update. You can download the file main.js and replace the one in the plugins folder with it to test it out.

Added the following macros...

Example usage... Cloud coverage %clouds%% - Will show Cloud coverage 50% Precipitation Past Hour %precipitation1h%mm - Will show Precipitation Past Hour 1.25mm

Note: In testing I found that the API returns a precipitation value for the past hour far more often than for the past 3 hours. In fact I have not yet had it return any value for the past 3 hours. Of course it took time to find a location that is currently even having any precipitation at the moment while I was testing but it does seem to work for me.

Let me know if you find any issues..

Trusku commented 1 year ago

Hi! It works fine for me too. Many thanks!

willasm commented 1 year ago

Thanks for the feedback. Let me know if you have any other issues.