diff --git a/apps/app1/notification.py b/apps/app1/notification.py index 2672634..143fdc3 100644 --- a/apps/app1/notification.py +++ b/apps/app1/notification.py @@ -4,4 +4,7 @@ from appdaemon.adapi import ADAPI class Notification: def __init__(self, ad: ADAPI) -> None: self.ad = ad - # self.ad.logger.info(' NEW LOG LINE '.center(50, '=')) + self.ad.logger.info(' NEW LOG LINE '.center(50, '=')) + + def send(self, message: str = "message not specified") -> None: + self.ad.log(message, level="DEBUG") diff --git a/apps/global_apps.yaml b/apps/global_apps.yaml index 412735d..2dcccf6 100644 --- a/apps/global_apps.yaml +++ b/apps/global_apps.yaml @@ -1,3 +1,6 @@ globals: module: globals global: true +companion_app: + module: app1.notification + global: true \ No newline at end of file diff --git a/apps/test/test.py b/apps/test/test.py index c903c6e..7fd2af2 100644 --- a/apps/test/test.py +++ b/apps/test/test.py @@ -5,5 +5,5 @@ from appdaemon.adbase import ADBase class Test(ADBase): def initialize(self): self.adapi = self.get_ad_api() - self.notification = Notification(self.adapi) - # self.notify.send("Test message from Test2 app.") + self.notify = Notification(self.adapi) + self.notify.send("Test message from Test2 app.") diff --git a/apps/test/test.yaml b/apps/test/test.yaml index 424f6fd..b97632c 100644 --- a/apps/test/test.yaml +++ b/apps/test/test.yaml @@ -1,4 +1,5 @@ test: module: test class: Test - log_level: DEBUG \ No newline at end of file + log_level: DEBUG + dependencies: companion_app \ No newline at end of file