@@ -8,28 +8,28 @@ callable as Python functions, so it's easy and concise to implement
8
8
logic.
9
9
10
10
Functions you write can be configured to be called as a service or run
11
- upon time, state-change or event triggers. Functions can also call any
12
- service, fire events and set state variables. Functions can sleep or
11
+ upon time, state-change, or event triggers. Functions can also call any
12
+ service, fire events, and set state variables. Functions can sleep or
13
13
wait for additional changes in state variables or events, without
14
14
slowing or affecting other operations. You can think of these functions
15
15
as small programs that run in parallel, independently of each other, and
16
16
they could be active for extended periods of time.
17
17
18
- State, event and time triggers are specified by Python function
18
+ State, event, and time triggers are specified by Python function
19
19
decorators (the "@" lines immediately before each function definition).
20
20
A state trigger can be any Python expression using state variables - the
21
21
trigger is evaluated only when a state variable it references changes,
22
22
and the trigger occurs when the expression is true or non-zero. A time
23
- trigger could be a single event (eg: date and time), a repetitive event
24
- (eg: at a particular time each day or weekday, daily relative to sunrise
25
- or sunset or any regular time period within an optional range) or using
23
+ trigger could be a single event (e.g., date and time), a repetitive event
24
+ (e.g., at a particular time each day or weekday, daily relative to sunrise
25
+ or sunset, or any regular time period within an optional range), or using
26
26
cron syntax (where events occur periodically based on a concise
27
- specification of ranges of minutes, hours, days of week, days of month
27
+ specification of ranges of minutes, hours, days of week, days of month,
28
28
and months). An event trigger specifies the event type, and an optional
29
29
Python trigger test based on the event data that runs the Python
30
30
function if true.
31
31
32
- Pyscript implements a Python interpreter using the ast parser output, in
32
+ Pyscript implements a Python interpreter using the AST parser output, in
33
33
a fully async manner. That allows several of the "magic" features to be
34
34
implemented in a seamless Pythonic manner, such as binding of variables
35
35
to states and functions to services. Pyscript supports imports, although
@@ -41,10 +41,10 @@ generators, ``yield``, and defining special class methods.
41
41
Pyscript provides a handful of additional built-in functions that connect
42
42
to HASS features, like logging, accessing state variables as strings
43
43
(if you need to compute their names dynamically), running and managing
44
- tasks, sleeping and waiting for triggers.
44
+ tasks, sleeping, and waiting for triggers.
45
45
46
46
Pyscript also provides a kernel that interfaces with the Jupyter
47
- front-ends (eg, notebook, console, lab and VSC). That allows you to develop
47
+ front-ends (eg, notebook, console, lab, and VSC). That allows you to develop
48
48
and test pyscript code interactively. Plus you can interact with much of
49
49
HASS by looking at state variables, calling services etc, in a similar
50
50
way to `HASS
@@ -59,11 +59,11 @@ which can be downloaded and run interactively in Jupyter notebook or VSC
59
59
connected to your live HASS with pyscript.
60
60
61
61
Pyscript provides functionality that complements the existing
62
- automations, templates and triggers. Pyscript is most similar to
62
+ automations, templates, and triggers. Pyscript is most similar to
63
63
`AppDaemon <https://appdaemon.readthedocs.io/en/latest/ >`__, and some
64
64
similarities and differences are discussed in this `Wiki
65
65
page <https://github.com/custom-components/pyscript/wiki/Comparing-Pyscript-to-AppDaemon> `__.
66
- Pyscript with Jupyter makes it extremely easy to learn, use and debug.
66
+ Pyscript with Jupyter makes it extremely easy to learn, use, and debug.
67
67
Pyscripts presents a simplified and more integrated binding for Python
68
68
scripting than `Python
69
69
Scripts <https://www.home-assistant.io/integrations/python_script> `__,
0 commit comments