From 423465a111bd032dd4e21a817d2df4e7448ceb10 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Thu, 6 Jun 2024 23:21:19 -0500 Subject: [PATCH] added dependency --- apps/app1/notification.py | 5 ++++- apps/global_apps.yaml | 3 +++ apps/test/test.py | 4 ++-- apps/test/test.yaml | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) 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