added parameter
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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, '*'))
|
||||
Reference in New Issue
Block a user