Pyscript 0.21 release
The 0.21 release contains a number of new features, and several bug fixes.
The main new features are:
- language support for classes, list/dict/set comprehensions, and assert
- an optional configuration parameter
allow_all_imports
can be set totrue
to allow any package to be imported (thanks to @basnijholt, #8) - "startup" is now a valid
@time_trigger
time_spec
, which allows a function to be called on startup and at additional specified times (#7) @task_unique
is a new decorator with the same arguments astask.unique()
(#1)- added
state.names()
to get a list of all entity ids for a given domain, or all if a domain is not specified (#12) - added
state.get_attr()
to get all the attributes (in adict
) for a state variable - added
print()
as an alias forlog.debug()
; it currently only supports a single argument - autocomplete in Jupyter now includes Python keywords
One breaking change is that assigning to a state variable (HASS entity id) now preserves its existing attributes (previously, setting a state variable would delete its attributes). The state.set()
function can be used to optionally overwrite or remove all attributes, or to set specific attributes while preserving others.
Bug fixes include:
- tuple assignments are fixed (fixes #14, #15)
- charset encoding on Jupyter messages is now utf-8 (fixes hass-puscript-jupyter #10)
Enjoy!