Hello, I have a question and I would like to ask for your help if possible.
Here I will describe my problem in more detail.
I am making a WatchFace (only for myself), I use OpenWeatherMap as a provider for weather data.
When I try to call Refresh weather, sometimes it only updates after an hour.
Is there any way to detect that the weather update failed and call it immediately (back)? I know that Background.registerForTemporalEvent
can only be called every five minutes, but I don't know how to call the update request back.
The weather refresh interval is set by myself via Application.Properties.getValue("WU")
Before I wrote to this forum, I tried to find a solution that would be useful but unsuccessfully.
Here I am attaching my code that I am using:
var lastTime = Background.getLastTemporalEventTime(); var nextEvent = lastTime != null ? lastTime.add(new Time.Duration(5)) : Time.now(); Background.registerForTemporalEvent(nextEvent); System.println("WU = 5 min."); } } else { } Background.registerForTemporalEvent(new Time.Duration(Application.Properties.getValue("WU") * 60)); System.println("WU User."+ Application.Properties.getValue("WU")); } }
Thank you