Skip to content

Commit c00b8a5

Browse files
committed
updates for allow_all_imports
1 parent 377c8d9 commit c00b8a5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ Pyscript implements a Python interpreter using the ast parser output, in a fully
2929
allows several of the "magic" features to be implemented in a seamless Pythonic manner, such as
3030
binding of variables to states and functions to services. Pyscript supports imports, although the
3131
valid import list is restricted for security reasons. Pyscript does not (yet) support some language
32-
features like declaring new objects, list comprehensions, generators and some syntax like `with`
33-
and `yield`. Pyscript provides a handful of additional built-in functions that connect to HASS
34-
features, like logging, accessing state variables as strings (if you need to compute their names
35-
dynamically), sleeping and waiting for triggers.
32+
features like generators and some syntax like `with` and `yield`. Pyscript provides a handful of
33+
additional built-in functions that connect to HASS features, like logging, accessing state variables
34+
as strings (if you need to compute their names dynamically), sleeping and waiting for triggers.
3635

3736
Pyscript also provides a kernel that interfaces with the Jupyter front-ends (eg, notebook, console
3837
and lab). That allows you to develop and test pyscript code interactively. Plus you can interact
@@ -85,7 +84,12 @@ this [README](https://github.com/craigbarratt/hass-pyscript-jupyter/blob/master/
8584

8685
## Configuration
8786

88-
* Add `pyscript:` to `<config>/configuration.yaml`; pyscript doesn't have any configuration settings
87+
* Add `pyscript:` to `<config>/configuration.yaml`; pyscript has one optional
88+
configuration parameter that allows any python package to be imported if set, eg:
89+
```yaml
90+
pyscript:
91+
allow_all_imports: true
92+
```
8993
* Create the folder `<config>/pyscript`
9094
* Add files with a suffix of `.py` in the folder `<config>/pyscript`.
9195
* Restart HASS.

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-
* Add `pyscript:` to `<config>/configuration.yaml`; pyscript doesn't have any configuration settings
26+
* Add `pyscript:` to `<config>/configuration.yaml`; there is one optional parameter (see docs)
2727
* Create the folder `<config>/pyscript`
2828
* Add files with a suffix of `.py` in the folder `<config>/pyscript`.
2929
* Whenever you change a script file, make a `reload` service call to `pyscript`.

0 commit comments

Comments
 (0)