Skip to content

Pyscript 0.21 release

Compare
Choose a tag to compare
@craigbarratt craigbarratt released this 05 Sep 05:23
· 517 commits to master since this 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 to true 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 as task.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 a dict) for a state variable
  • added print() as an alias for log.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:

Enjoy!