Skip to content

Commit 12b1e84

Browse files
committed
clarified that pyscript.app_config`` is not defined in regular scripts
1 parent fbbce53 commit 12b1e84

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/reference.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ configuration settings are available via the variable ``pyscript.config``, which
7979
all the application configuration below the ``apps`` key. However, in a future release the
8080
``apps`` entry will be removed so that apps do not have access to another app's configuration
8181
(which might include token, passwords or keys). See `this section <#accessing-yaml-configuration>`__
82-
for more information.
82+
for more information. Note that ``pyscript.app_config`` is not defined in regular scripts - only
83+
in each application's main file.
8384

8485
Note that if you used the UI flow to configure pyscript, the ``allow_all_imports`` and
8586
``hass_is_global`` configuration settings will be ignored in the yaml file. In that case
@@ -638,7 +639,7 @@ In ``@time_trigger``, each string specification ``time_spec`` can take one of fo
638639
``6,10-13`` that means hours of 6,10,11,12,13. The trigger happens on the next minute, hour, day
639640
that matches the specification. See any Linux documentation for examples and more details (note:
640641
names for days of week and months are not supported; only their integer values are). The cron
641-
features use the ``croniter`` package, so check its `documentation <https://pypi.org/project/croniter/>`
642+
features use the ``croniter`` package, so check its `documentation <https://pypi.org/project/croniter/>`__
642643
for additional specification formats that are supported (eg: ``*/5`` repeats every 5th unit,
643644
days of week can be specified with English abbreviations, and an optional 6th field allows seconds
644645
to be specified).
@@ -1707,7 +1708,8 @@ Pyscript binds all of its ``yaml`` configuration to the variable ``pyscript.conf
17071708
you to add configuration settings that can be processed by your pyscript code. Additionally, an
17081709
application's configuration (eg, for an application ``app_name``, all the settings in ``app_name``
17091710
below ``apps``) are available in the variable ``pyscript.app_config`` in the global scope of the
1710-
application's main file (eg, ``apps/app_name.py`` or ``apps/app_name/__init__.py``).
1711+
application's main file (eg, ``apps/app_name.py`` or ``apps/app_name/__init__.py``). Note that
1712+
``pyscript.app_config`` is not defined in regular scripts - only in each application's main file.
17111713

17121714
One motivation is to allow pyscript apps to be developed and shared that can instantiate triggers
17131715
and logic based on ``yaml`` configuration. That allows other users to use and configure your

0 commit comments

Comments
 (0)