felixhageloh / weather-widget

A weather widget for Übersicht
64 stars 32 forks source link

Cache last valid response and add 'last updated at' info #33

Open YayC opened 8 years ago

YayC commented 8 years ago

Great widget! I've just been having an issue where the "Could not retrieve weather data" error is popping up quite frequently, which wipes out the whole forecast from the view. You can see how it looks if you turn off your internet connection when the widget tries to refresh.

When there is an error fetching new data, it would be awesome if it would keep data from the last valid response since that (slightly outdated) info is still very useful. A complementary feature would be to display a "last updated at" field so the user would know how fresh the info is.

felixhageloh commented 8 years ago

good suggestion!

wezzer commented 8 years ago

Thumbs up for this! Excellent widget, but requires live connection to Internet all the time...

kyletitus commented 7 years ago

I have put in a pull request that should resolve this issue. It adds caching and some retry logic. You can review it/test it out here. https://github.com/felixhageloh/weather-widget/pull/37