Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New Weather API - Not Updating

ANSWERED

I'm new to programming in general, so I'm trying to put together a clock face. I've been able to get steps, distance, and a battery meter to update by using "clock.ontick = (evt) =>".. but I cannot figure out how to get the new weather API to do the same by using "display.onchange = (evt) =>"

 

I just copied all the code from: https://github.com/Fitbit/sdk-weather-clock and pasted it into my project. It works and displays the weather, but it doesn't refresh unless I select the watch face in the app. The code in the link looks a lot different than what I'm used to. I'm using the 4.3 SDK for the Versa 2.

 

It might even be better if it could update after a certain interval, like an hour or so. But I'm just not sure how to make it do that.

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

Hi @Limelon - you can use setInterval() to schedule a regular hourly update.

Author | ch, passion for improvement.

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

Hi @Limelon - you can use setInterval() to schedule a regular hourly update.

Author | ch, passion for improvement.

Best Answer
0 Votes

Thanks! I just figured it out. I was stupid and didn't realize there was a couple other files I wasn't looking at under the companion and common folders. Plus I forgot to enable the "run in background" permission!! Working perfectly now. 🙂

Best Answer