Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


tips:weatherage

This is an old revision of the document!


Indicate the Age of the Last Weather Update

Having the current weather conditions show on your watch is nice, but how do you know that they're actually… you know… *current*? Here's one way to quickly indicate that, without taking up a lot of space.

Example

Change Current Temp Color

 Tint:  ((dh24}*60)+{dm})-((string.sub('{wlu}',1,2)*60)+(string.sub('{wlu}',4,5)))<5 and 'ffff00' or 'ffffff'

Explanation

The obvious way to display the last update time is to simply use the {wlu} tag, but that takes up a lot of real estate, and doesn't always fit the theme of your watch. A simple way to indicate that the weather isn't current is to change the color of one of the displayed items. I like to use the “Current Temperature” display, since that's probably what you care most about, but it can really be *any* item.

Simply change the tint value of that item with the formula above. What that does is convert both the current 24-hour time and the {wlu} time to the number of elapsed minutes in the current day. Then, it simply subtracts the {wlu} total from the time total. This gives you the number of elapsed minutes since the last update. If that's less than 5, the current temperature display turns yellow. Otherwise, it's white.

This is best used with a tap action to update weather, since it can take a few seconds to actually update, and the color change will indicate when that has happened.

Now, there is a slight problem with this formula, since it can't cross midnight. In other words, if weather updates at 23:59, but it's currently 00:01, it will *not* indicate as current. But, that's a minor quibble. it could be fixed, but it'd mean testing for date as well which would complicate the formula considerably for such a small gain, especially since a quick “update weather” tap action immediately resolves the issue.

tips/weatherage.1423847937.txt.gz · Last modified: 2015/02/13 17:18 by jt3