Changes between Version 14 and Version 15 of WikiStart


Ignore:
Timestamp:
2012-09-26 17:30:22 (12 years ago)
Author:
guessed
Comment:

Move the examples to this wiki, since it's maintained.

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v14 v15  
    3131= Scene Scripting = 
    3232The Weather Plugin exposes a number of Variables: 
    33  *  `Condition` (String) something representing the current Weather state.[[br]] 
     33 *  `Condition` (String) something representing the current Weather state (subject to language translation).[[br]] 
     34 *  `ConditionGroup` (String) an aggregation of weather Condititions to make scripting simpler (not subject to language translation) 
    3435 *  `WindCondition` (String) a value like "`W at 2 mph`". 
    3536 *  `WindSpeed` (Number) a value like "`2`" extracted from the `WindCondition`, specified in Local units (either kph or mph depending upon the setting of `Metric`) 
     
    3738 *  `Period` (Number) the number of seconds to delay before automatically polling the Weather feed.  If blank, the default is 1800 seconds (30 minutes).  This value cannot be < 10 or > 3600. 
    3839 
    39 These variables can be accessed in Luup scenes using code illustrated here: 
    40   * [http://wiki.micasaverde.com/index.php/Luup_Variables#Weather_Plugin Weather Plugin in Scenes] 
     40These variables can be accessed in Luup scenes. 
     41 
     42== Examples == 
     43To prevent a scene from firing when the weather is poor: 
     44 
     45{{{ 
     46#!div style="font-size: 80%" 
     47  {{{#!lua 
     48local t = luup.variable_get("urn:upnp-micasaverde-com:serviceId:Weather1", "ConditionGroup", 104) 
     49if  ( (t == "sleet") 
     50    or (t == "tstorms") 
     51    or (t == "rain") 
     52    or (t == "snow") 
     53    or (t == "flurries") 
     54then 
     55  return true 
     56else 
     57  return false 
     58end 
     59  }}} 
     60}}} 
     61 
    4162 
    4263Further examples can be found in the Discussion area referenced below. 
    4364 
    4465The condition phrases are listed on the WUI site: 
    45   * [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases Current Condition Phrases] 
    46   * [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#forecast_description_phrases Forecast Condition Phrases] 
     66  * `Condition` - [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#current_condition_phrases Current Condition Phrases] 
     67  * `ConditionGroup` - [http://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary#forecast_description_phrases Forecast Condition Phrases] 
    4768 
    4869= Discussion =