From 1135082055ec10cc045ebe316bc3061dde5df746 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:10:02 -0500 Subject: [PATCH] more complexity to test case --- apps/app1/database.py | 8 ++++---- apps/apps.yaml | 4 ++++ apps/globals/globals.py | 1 + apps/test/test.py | 9 +++++++++ apps/test/test.yaml | 4 ++++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 apps/globals/globals.py create mode 100644 apps/test/test.py create mode 100644 apps/test/test.yaml diff --git a/apps/app1/database.py b/apps/app1/database.py index 9a36c48..c58bb21 100644 --- a/apps/app1/database.py +++ b/apps/app1/database.py @@ -1,6 +1,6 @@ from appdaemon.adapi import ADAPI -class DatabaseApp(ADAPI): - def initialize(self): - self.log(f'Initialized from {__file__}') - \ No newline at end of file + +class Database: + def __init__(self, ad: ADAPI) -> None: + self.ad = ad diff --git a/apps/apps.yaml b/apps/apps.yaml index 492c452..015ad27 100644 --- a/apps/apps.yaml +++ b/apps/apps.yaml @@ -14,4 +14,8 @@ Hello: module: hello class: HelloWorld +globals: + module: globals + global: true + # Foo: bar \ No newline at end of file diff --git a/apps/globals/globals.py b/apps/globals/globals.py new file mode 100644 index 0000000..abe9573 --- /dev/null +++ b/apps/globals/globals.py @@ -0,0 +1 @@ +GLOBAL_CONSTANT = True \ No newline at end of file diff --git a/apps/test/test.py b/apps/test/test.py new file mode 100644 index 0000000..cd2b1ac --- /dev/null +++ b/apps/test/test.py @@ -0,0 +1,9 @@ +from app1.database import Database +from appdaemon.adbase import ADBase + + +class Test(ADBase): + def initialize(self): + self.adapi = self.get_ad_api() + self.database = Database(self.adapi) + # self.notify.send("Test message from Test2 app.") diff --git a/apps/test/test.yaml b/apps/test/test.yaml new file mode 100644 index 0000000..424f6fd --- /dev/null +++ b/apps/test/test.yaml @@ -0,0 +1,4 @@ +test: + module: test + class: Test + log_level: DEBUG \ No newline at end of file