1
- New Features
2
- ============
1
+ Released and New Features
2
+ =========================
3
3
4
4
The releases and release notes are available on `GitHub <https://github.com/custom-components/pyscript/releases >`__.
5
5
Use HACS to install different versions of pyscript.
@@ -8,69 +8,13 @@ You can also install the master (head of tree) version from GitHub, either using
8
8
Because pyscript has quite a few unit tests, generally the master version should work ok. But it's not
9
9
guaranteed to work at any random time, and newly-added features might change.
10
10
11
- The latest release is 1.2.1 , released on February 9 , 2021. Here is the `stable documentation
12
- <https://hacs-pyscript.readthedocs.io/en/stable > `__ for that release.
11
+ This release is 1.3.0 , released on February 24 , 2021. Here is the `documentation
12
+ <https://hacs-pyscript.readthedocs.io/en/1.3.0 > `__ for this release.
13
13
14
14
Over time, the master (head of tree) version in GitHub will include new features and bug fixes.
15
15
Here is the `latest documentation <https://hacs-pyscript.readthedocs.io/en/latest >`__ if you want
16
16
to see the development version of the documentation.
17
17
18
- If you want to see development progress since 1.2.1, see
19
- `new features <https://hacs-pyscript.readthedocs.io/en/latest/new_features.html >`__
20
- in the latest documentation.
21
-
22
- Planned new features post 1.2.1 include:
23
-
24
- - Consider supporting the built-in functions that do I/O, such as ``open ``, ``read `` and ``write ``, which
25
- are not currently supported to avoid I/O in the main event loop, and also to avoid security issues if people
26
- share pyscripts. The ``print `` function only logs a message, rather than implements the real ``print `` features,
27
- such as specifying an output file handle. Support might be added in the future using an executor job, perhaps
28
- enabled when ``allow_all_imports `` is set.
29
-
30
- The new features since 1.2.1 in master include:
31
-
32
- - Multiple trigger decorators (``@state_trigger ``, ``@time_trigger ``, ``@event_trigger `` or ``@mqtt_trigger ``)
33
- per function are now supported. See #157.
34
- - Trigger decorators (``@state_trigger ``, ``@time_trigger ``, ``@event_trigger `` or ``@mqtt_trigger ``) support
35
- an optional ``kwargs `` keyword argument that can be set to a ``dict `` of keywords and values, which are
36
- passed to the trigger function. See #157.
37
- - The ``@service `` decorator now takes one of more optional arguments to specify the name of the service of the
38
- form ``"DOMAIN.SERVICE" ``. The ``@service `` also can be used multiple times as an alternative to using multiple
39
- arguments. The default continues to be ``pyscript.FUNC_NAME ``.
40
- - Added ``@pyscript_executor `` decorator, which does same thing as ``@pyscript_compile `` and additionally wraps
41
- the resulting function with a call to ``task.executor ``. See #71.
42
- - Added ``watch `` keyword argument to ``@state_trigger ``, which allows the list or set of state variables that
43
- are monitored to be specified. Normally that list is extracted from the ``@state_trigger `` expression.
44
- - Errors in trigger-related decorators (eg, wrong arguments, unregonized decorator type) raise exceptions rather
45
- than logging an error.
46
- - Types of keyword arguments to trigger decorators are now checked and exceptions raised if incorrect.
47
- - Added error checking for ``@pyscript_compile `` and ``@pyscript_executor `` to enforce there are no args or kwargs.
48
-
49
- Breaking changes since 1.2.1 include:
50
-
51
- - Since decorator errors now raise exceptions, if you had a script with such an error that otherwise works, that
52
- script will now give an exception and fail to load. The error should be self-explanatory, and it's good to know
53
- so you can fix it.
54
- - Since an exception is now raised if you call a function with an invalid keyword argument (ie, one not included
55
- in the function's argument definition), if you previsouly had a misspelled keyword argument that was silently
56
- ignored, you will now get an exception. It's good to know that is the case, and it should be easy to fix.
57
- - The use of ``pyscript.config["apps"][YOUR_APP] `` to get application configuration is still available but now
58
- deprecated. The ``apps `` entry in ``pyscript.config `` will be removed in a future release. This is to prevent
59
- wayward applications from seeing configuration settings for other apps. The new ``pyscript.app_config `` variable
60
- should be used instead - it is set to ``pyscript.config["apps"][YOUR_APP] `` for each app.
61
-
62
- Bug fixes since 1.2.1 include:
63
-
64
- - Fixed ``@state_trigger `` with only a ``.old `` variable, which previously never triggered; reported by stigvi.
65
- - Reload with global_ctx="*" and reload via Configuration -> Integrations UI menu now start triggers, reported by Fabio C.
66
- - Fixed subscripts when running python 3.9.x.
67
- - Timeouts that implement time triggers might infrequenctly occur a tiny time before the target time. A fix was added
68
- to do an additional short timeout when there is an early timeout, to make sure any time trigger occurs at or shortly
69
- after the target time (and never before).
70
- - Fixes to ``locals() ``, ``exec() `` and ``eval() `` so that various scoping scenarios work correctly.
71
- - When exception text is created, ensure lineno is inside code_list[]; with lambda function or eval it might not be.
72
- - An exception is raised when a function is called with unexpected keyword parameters that don't have corresponding
73
- keyword arguments (however, the trigger parameter names are excluded from this check, since trigger functions
74
- are allowed to have any subset of keyword arguments).
75
- - Non-local keyword arguments in inner functions are now correctly resolved; see #163
76
- - Trigger on any state change now matches state names with leading digits; see #165
18
+ If you want to see development progress since 1.3.0, see
19
+ `new features <https://hacs-pyscript.readthedocs.io/en/latest/new_features.html >`__ in the latest
20
+ documentation, or look at the `GitHub repository <https://github.com/custom-components/pyscript >`__.
0 commit comments