From 03ebbcc1f0becd70df6e13064fb8acc43dffe982 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:55:32 -0500 Subject: [PATCH] added variant --- apps/test/test.yaml | 6 ++++-- apps/test/test_notify.py | 2 +- apps/test/variant.py | 9 +++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 apps/test/variant.py diff --git a/apps/test/test.yaml b/apps/test/test.yaml index d5edb22..c7fd69b 100644 --- a/apps/test/test.yaml +++ b/apps/test/test.yaml @@ -1,5 +1,7 @@ test_notifier: - module: test_notify - class: TestNotifier + # module: test_notify + # class: TestNotifier + module: variant + class: Variant log_level: DEBUG # dependencies: companion_app \ No newline at end of file diff --git a/apps/test/test_notify.py b/apps/test/test_notify.py index b407066..7040ff7 100644 --- a/apps/test/test_notify.py +++ b/apps/test/test_notify.py @@ -7,5 +7,5 @@ class TestNotifier(ADBase): self.adapi = self.get_ad_api() self.log = self.adapi.log self.log(f'Initialized test notifier class: {self.__class__.__name__}') - self.notify = Notification(self.adapi) + self.notify = Notification(self.adapi, self.name) self.notify.send('Some notifications') diff --git a/apps/test/variant.py b/apps/test/variant.py new file mode 100644 index 0000000..b19119f --- /dev/null +++ b/apps/test/variant.py @@ -0,0 +1,9 @@ +from test_notify import TestNotifier +from appdaemon.adapi import ADAPI + +class Variant(TestNotifier, ADAPI): + def initialize(self): + self.adapi = self.get_ad_api() + self.log = self.adapi.log + self.log('Variant of the TestNotifier') + # self.log(' VARIANT '.center(50, '*'))