Skip to content

Commit c0bb8d1

Browse files
committed
a few minor edits
1 parent 5f571a6 commit c0bb8d1

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

docs/new_features.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The new features since 0.32 in master include:
1919
- Pyscript state variables (entity_ids) can be persisted across pyscript reloads and HASS restarts,
2020
from @swazrgb and @dlashua (#48).
2121
- ``@state_trigger`` now supports triggering on an attribute change with ``"domain.entity.attr"`` and
22-
any attribute change with ``"domain.entity.*"``, submitted by @dlashua (#82)
22+
any attribute change with ``"domain.entity.*"``, from @dlashua (#82)
2323
- State variables now support virtual attributes ``last_changed`` and ``last_updated`` for the UTC time when state
2424
values or any attribute was last changed.
2525
- State variable values (eg, from ``domain.entity`` or ``state.get()``) now include attributes that can be accessed
@@ -34,11 +34,11 @@ The new features since 0.32 in master include:
3434
is true (default false). This allows access to HASS internals that might not be otherwise exposed by pyscript.
3535
Use with caution (#51).
3636
- Improvements to UI config flow, including allowing parameters to be updated, and the UI reload now works the same
37-
as the ``pyscript.reload`` service call, submitted by @raman325 (#53)
37+
as the ``pyscript.reload`` service call, from @raman325 (#53)
3838
- Added inbound ``context`` variable to trigger functions and support optional ``context`` setting on state,
39-
event firing and service calls. Proposal and PR by @dlashua (#50, #60).
39+
event firing and service calls. Proposal and PR from @dlashua (#50, #60).
4040
- Logbook now supported using ``context`` and informational message based on trigger type. Proposal and PR
41-
by @dlashua (#50, #62).
41+
from @dlashua (#50, #62).
4242
- Required Python packages can be specified in ``requirements.txt`` files at the top-level pyscript
4343
directory, and each module's or app's directory. Those files are read and any missing packages are
4444
installed on HASS startup and pyscript reload. If a specific version of a package is needed, it must be
@@ -69,5 +69,5 @@ The bug fixes since 0.32 in master include:
6969
- Jupyter autocomplete now works on multiline code blocks.
7070
- Improved error message reporting for syntax errors inside f-strings.
7171
- Fixed incorrect global context update on calling module that, in turn, does a callback (#58).
72-
- `task.wait_until` no longer silently ignores unrecognized keyword arguments (#80).
73-
- `task.wait_until` incorrectly ignored the keyword optional state_check_now argument (#81).
72+
- ``task.wait_until`` no longer silently ignores unrecognized keyword arguments (#80).
73+
- ``task.wait_until`` incorrectly ignored the keyword optional state_check_now argument (#81).

docs/reference.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ function.
260260
@state_trigger(str_expr, ..., state_hold=None, state_check_now=False)
261261
262262
``@state_trigger`` takes one or more string arguments that contain any expression based on one or
263-
more state variables, and evaluates to ``True`` or ``False`` (or non-zero or zero). Whenever the
264-
state variables or attributes values mentioned in the expression change, the expression is evaluated
265-
and the trigger occurs if it evaluates to ``True`` (or non-zero). For each state variable,
263+
more state variables, and evaluates to ``True`` or ``False`` (or non-zero or zero). Whenever any
264+
of the state variables or attribute values mentioned in the expression change, the expression is
265+
evaluated and the trigger occurs if it evaluates to ``True`` (or non-zero). For each state variable,
266266
eg: ``domain.name``, the prior value is also available to the expression as ``domain.name.old``
267267
in case you want to condition the trigger on the prior value too. Attribute values can be used
268268
in the expression too, using the forms ``domain.name.attr`` and ``domain.name.old.attr`` for
@@ -312,12 +312,10 @@ form ``DOMAIN.name.attr``. Attributes maintain their original type, so there is
312312
then to another type.
313313

314314
You can specify a state trigger on any change with a string that can take three forms:
315-
``"domain.entity"``
316-
triggers on any change to the state variable value
317-
``"domain.entity.attr"``
318-
triggers on any change to the state variable attribute ``attr`` value
319-
``"domain.entity.*"``
320-
triggers on any change to any state variable attribute (but not its value)
315+
316+
- ``"domain.entity"``: triggers on any change to the state variable value
317+
- ``"domain.entity.attr"``: triggers on any change to the state variable attribute ``attr`` value
318+
- ``"domain.entity.*"``: triggers on any change to any state variable attribute (but not its value)
321319

322320
For example:
323321

info.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ See the documentation if you want to install pyscript manually.
2323

2424
## Configuration
2525

26-
* Go to the Integrations menu in the Home Assistant Configuration UI and add `Pyscript Python scripting` from there, or add `pyscript:` to `<config>/configuration.yaml`; there is one optional parameter (see docs)
26+
* Go to the Integrations menu in the Home Assistant Configuration UI and add `Pyscript Python scripting` from there, or add `pyscript:` to `<config>/configuration.yaml`; see docs for optional parameters
2727
* Add files with a suffix of `.py` in the folder `<config>/pyscript`.
2828
* Whenever you change a script file, make a `reload` service call to `pyscript`.
2929
* Watch the HASS log for `pyscript` errors and logger output from your scripts.

0 commit comments

Comments
 (0)