Skip to content

Commit 658a2a0

Browse files
committed
added new task functions and autoreload
1 parent ef9a999 commit 658a2a0

File tree

3 files changed

+169
-90
lines changed

3 files changed

+169
-90
lines changed

docs/configuration.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
Configuration
22
=============
33

4-
- Pyscript can be configured using the UI, or via yaml. To use the UI, go to the
5-
Configuration -> Integrations page and selection "+" to add ``Pyscript Python scripting``.
6-
After that, you can change the settings anytime by selecting Options under Pyscript
7-
in the Configuration page.
4+
- Pyscript can be configured using the UI, or via yaml. To use the UI, go to the
5+
Configuration -> Integrations page and selection "+" to add ``Pyscript Python scripting``.
6+
After that, you can change the settings anytime by selecting Options under Pyscript
7+
in the Configuration page.
88

9-
Alternatively, for yaml configuration, add ``pyscript:`` to ``<config>/configuration.yaml``.
10-
Pyscript has two optional configuration parameters that allow any python package to be
11-
imported and exposes the ``hass`` variable as a global (both options default to ``false``):
9+
Alternatively, for yaml configuration, add ``pyscript:`` to ``<config>/configuration.yaml``.
10+
Pyscript has two optional configuration parameters that allow any python package to be
11+
imported and exposes the ``hass`` variable as a global (both options default to ``false``):
1212

13-
.. code:: yaml
13+
.. code:: yaml
1414
15-
pyscript:
16-
allow_all_imports: true
17-
hass_is_global: true
15+
pyscript:
16+
allow_all_imports: true
17+
hass_is_global: true
1818
19-
- Add files with a suffix of ``.py`` in the folder ``<config>/pyscript``.
20-
- Restart HASS after installing pyscript.
21-
- Whenever you change a script file, app or configuration, make a ``reload`` service call to ``pyscript``
22-
and just those changes will be reloaded. To reload all files and apps, set the optional ``global_ctx``
23-
parameter to ``*``.
24-
- Watch the HASS log for ``pyscript`` errors and logger output from your scripts.
19+
- Add files with a suffix of ``.py`` in the folder ``<config>/pyscript``.
20+
- Restart HASS after installing pyscript.
21+
- Whenever you change a script file or app, pyscript will automatically reload the changed files.
22+
To reload all files and apps, call the ``pyscript.reload`` service with the optional
23+
``global_ctx`` parameter to ``*``.
24+
- Watch the HASS log for ``pyscript`` errors and logger output from your scripts.

docs/new_features.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Planned new features post 1.1.0 include:
3131
The new features since 1.1.0 in master include:
3232

3333
- Reload is automatically done whenever a script file, ``requirements.txt`` or ``yaml`` file below the
34-
``pyscripts`` folder is modified, created, renamed or deleted, or a directory is renamed, created or
34+
``pyscript`` folder is modified, created, renamed or deleted, or a directory is renamed, created or
3535
deleted (see #74).
3636
- New functions ``task.create``, ``task.cancel``, ``task.wait``, ``task.add_done_callback``,
3737
``task.remove_done_callback`` allow new background (async) tasks to be created, canceled, waited on,

0 commit comments

Comments
 (0)