@@ -438,8 +438,8 @@ If it evaluates to `False` (or zero), the trigger is ignored and the trigger fun
438438
439439` @time_active` takes one or more strings that specify time-based ranges. When any trigger
440440occurs (whether time, state or event), each time range specification is checked. If the
441- current time doesn't fall within every range specified, the trigger is ignored and the trigger
442- function is not called.
441+ current time doesn't fall within any range specified, the trigger is ignored and the
442+ trigger function is not called.
443443
444444Each string specification can take two forms :
445445- ` "range(datetime_start, datetime_end)"` is satisfied if the current time is in the indicated
@@ -514,10 +514,18 @@ includes a period. This is one aspect where the interpreter behaves differently
514514
515515# ### Accessing state variables
516516
517+ State variables can be used and set just by using them as normal Python variables. However, there could
518+ be cases where you want to dynamically generate the variable name (eg, in a loop). These functions
519+ allow you to get and set a variable using its string name. The set function also allows you to optionally
520+ set the attributes, which you can't do if you are directly assigning to the variable :
521+
517522` state.get(name)` returns the value of the state variable, or `None` if it doesn't exist
518523
519524` state.set(name, value, attr=None)` sets the state variable to the given value, with the optional attributes.
520525
526+ Note that in Hass, all state variable values are coerced into strings. For example, if a state variable
527+ has a numberic value, you will have to convert it to a numeric type (eg, using `int()` or `float()`).
528+
521529# ### Service Calls
522530
523531` service.call(domain, name, **kwargs={})` calls the service `domain.name` with the given keyword arguments as
0 commit comments