Skip to content

Commit c859e67

Browse files
committed
fixed filename key
1 parent f40b4c8 commit c859e67

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -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
440440
occurs (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

444444
Each 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

hacs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"content_in_root": false,
44
"domains": ["automation", "script", "timer"],
55
"zip_release": true,
6-
"file_name": "hass-custom-pyscript.zip"
6+
"filename": "hass-custom-pyscript.zip"
77
}

0 commit comments

Comments
 (0)