Watchmaker Wiki

The ultimate watch maker for Android Wear!

User Tools

Site Tools


weather

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
weather [2015/01/20 19:18] – [Weather Widget] splitbrainweather [2015/01/20 19:41] – moved to sprites splitbrain
Line 1: Line 1:
-====== Weather Widget ====== 
  
-{{ :official:images:weather_set_1.png?200}} 
-Weather Widgets are [[image]] widgets so please refer to them for their general use. 
- 
-To display the current weather conditions, the weather widget uses a special image that contains multiple icons (also called a sprite). Nine different states are supported in the weather sets delivered with Watchmaker: 
- 
-  - sunny 
-  - FIXME 
-  - FIXME 
-  - FIXME 
-  - light rain 
-  - heavy rain 
-  - thunderstorm 
-  - snow 
-  - cloudy 
- 
-By default the weather widget shows the current weather condition as provided by the [[settings#weather provider]]. You can switch it to forecast conditions by adjusting the image selection property as described below. 
-===== Using your own image ===== 
- 
-You can provide your own image. To do so select it in the "Custom Image" property and make sure to adjust the "image grid" property to match the layout of your sprite. 
- 
-Which icon is displayed is displayed is determined by the "Image Selection" property. It should contain a [[lua]] expression returning the number of the image to show (on a 3x3 grid, 1 is the top left corner, 3 is top right and 9 is bottom right). 
- 
-The default expression is this: 
- 
-<code lua> 
-'{wci}' == '01d' and 1 or '{wci}' == '02d' and 2 or '{wci}' == '03d' and 3 or '{wci}' == '04d' and 4 or '{wci}' == '09d' and 5 or '{wci}' == '10d' and 6 or '{wci}' == '11d' and 7 or '{wci}' == '13d' and 8 or '{wci}' == '50d' and 9 or 1 
-</code> 
- 
-''{wci}'' of course refers to the [[tags#weather tag]] containing the weather icon information. The expression maps the many states this tag can have to the 9 available icons. 
- 
-''{wci}'' can have the following values: 
- 
-^ Value ^ Condition ^ 
-| FIXME | FIXME     | 
weather.txt · Last modified: 2018/02/21 10:20 by alex_curran