diff --git a/apps/app1/notification.py b/apps/app1/notification.py index 6a4d1d7..fde99f4 100644 --- a/apps/app1/notification.py +++ b/apps/app1/notification.py @@ -2,10 +2,10 @@ from appdaemon.adapi import ADAPI class Notification: - def __init__(self, ad: ADAPI) -> None: + def __init__(self, ad: ADAPI, name: str) -> None: self.ad = ad self.log = self.ad.logger.info - self.log('Notification initialize') + self.log(f'Notification initialized for {name}') # self.ad.logger.info(' NOTIFICATION '.center(50, '-')) def send(self, message: str = 'message not specified') -> None: diff --git a/apps/app1/subdir/foo.py b/apps/app1/subdir/foo.py index 8eac778..eb1589c 100644 --- a/apps/app1/subdir/foo.py +++ b/apps/app1/subdir/foo.py @@ -7,6 +7,7 @@ from ..notification import Notification class Foo(ADAPI): def initialize(self): + # self.log('FOO') self.log(f'Initialized app from {Path(__file__).relative_to(self.AD.app_dir.parent)}') - self.notification = Notification(self.AD) - # self.log(' FOO '.center(50, '-')) + self.notification = Notification(self.AD, self.name) + # self.log(' FOO '.center(50, '*')) \ No newline at end of file diff --git a/apps/my_repo/src/my_pkg/foo.py b/apps/my_repo/src/my_pkg/foo.py index 71389f3..85b2edf 100644 --- a/apps/my_repo/src/my_pkg/foo.py +++ b/apps/my_repo/src/my_pkg/foo.py @@ -2,17 +2,11 @@ from pathlib import Path from appdaemon.adbase import ADBase -filename = Path(__file__).name -# print(f' Importing {filename} '.center(50, '-')) class Foo(ADBase): changes: bool = True def initialize(self): self.adapi = self.get_ad_api() - - self.adapi.log(f'Initialized app from {filename} new line changes: {self.changes}') - # self.adapi.log(f'New log line: {self.changes}') - # self.adapi.log(f'Even newer log line: {self.changes}') - -# print(f' Foo.changes = {Foo.changes} '.center(50, '-')) + self.adapi.log(f'Initialized app from {Path(__file__).relative_to(self.AD.app_dir.parent)}') + self.adapi.log(f'new line changes: {self.changes}')