You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/APPGUIDE.rst
+4-4
Original file line number
Diff line number
Diff line change
@@ -572,8 +572,8 @@ Global Module Dependencies
572
572
The previously described dependencies and load order have all been at the App level.
573
573
It is however, sometimes convenient to have global modules that have no apps in them that nonetheless
574
574
require dependency tracking. For instance, a global module might have a number of useful
575
-
variables or functions in it. When they change, a number of apps may need to be restarted.
576
-
as of AppDaemon 4.5 these dependencies are tracked autmatically and should just work.
575
+
variables or functions in it. When they change, a number of apps may need to be restarted.
576
+
as of AppDaemon 4.5 these dependencies are tracked autmatically and should just work.
577
577
It is neccesarry to take some care about how apps are structured, especially if multiple subdirectories are used.
578
578
579
579
AppDir Structure
@@ -599,7 +599,7 @@ but as the number of apps grows, it can be useful to organize them into subdirec
599
599
common.yaml
600
600
601
601
602
-
In this example, AppDaemon will find all the apps in the app1, app2, and app3 directories, as well as the common.py and common.yaml files in the common directory.
602
+
In this example, AppDaemon will find all the apps in the app1, app2, and app3 directories, as well as the common.py and common.yaml files in the common directory.
603
603
The apps can be configured in their respective YAML files, and they can also import functions or classes from the common module if needed, as long as some simple rules are adhered to.
604
604
605
605
- If app1 wants to import a function called `common_funtion` from common.py, it can do so using the following import statement:
@@ -609,7 +609,7 @@ The apps can be configured in their respective YAML files, and they can also imp
609
609
from common import common_function
610
610
611
611
Note that there are no relative paths here - the AppDaemon system in combination with standard python rules will reslove this correctly,
612
-
and importantly, will understand that app1 now relies on common.py, and any changes to common.py will result it common.py being reloaded,
612
+
and importantly, will understand that app1 now relies on common.py, and any changes to common.py will result it common.py being reloaded,
613
613
but this will also result in a reload of app1.py to pick up the changes
614
614
615
615
- if app2 is a package in it's own right (e.g. it has an __init__.py at the top level) #### John, what happens here???
0 commit comments