From 727bfbac1d2a27475b7fe962ae04cba65373026b Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Tue, 28 Jan 2025 22:39:12 -0600 Subject: [PATCH] rearranged a bit --- conf/apps/{deep/arbitrary/path => globals}/hal.py | 0 conf/apps/globals/utils.py | 8 ++++++++ conf/apps/perimeter.py | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) rename conf/apps/{deep/arbitrary/path => globals}/hal.py (100%) create mode 100644 conf/apps/globals/utils.py diff --git a/conf/apps/deep/arbitrary/path/hal.py b/conf/apps/globals/hal.py similarity index 100% rename from conf/apps/deep/arbitrary/path/hal.py rename to conf/apps/globals/hal.py diff --git a/conf/apps/globals/utils.py b/conf/apps/globals/utils.py new file mode 100644 index 0000000..894e63b --- /dev/null +++ b/conf/apps/globals/utils.py @@ -0,0 +1,8 @@ +CONSTANTS = { + 'A': 1, + 'B': 2, + 'C': 3 +} + +def utility_function(): + return 123, 456 diff --git a/conf/apps/perimeter.py b/conf/apps/perimeter.py index 1803590..d95f3af 100644 --- a/conf/apps/perimeter.py +++ b/conf/apps/perimeter.py @@ -1,8 +1,9 @@ from appdaemon.adapi import ADAPI import hal -import statemachine +# import statemachine import rules +import globals.utils class Perimeter(ADAPI): @@ -11,3 +12,4 @@ class Perimeter(ADAPI): self.rules = rules.Rule1('abc'), rules.Rule2(123) self.log(f'Initialized perimeter: {self.hal.args}') self.log(f'Rules: {self.rules}') + self.log(f'{globals.utils.CONSTANTS}')