foo, bar, baz rename

This commit is contained in:
John Lancaster
2024-03-18 18:03:54 -05:00
parent 9c12df1256
commit c0d7871676
8 changed files with 58 additions and 33 deletions

View File

@@ -1,11 +1,11 @@
hello_world: Foo:
module: hello module: foo
class: HelloWorld class: Foo
hello_sub: Bar:
module: my_pkg.my_sub_pkg.hello
class: HelloWorldSub
motion:
module: my_pkg module: my_pkg
class: Motion class: Bar
Baz:
module: my_pkg.my_sub_pkg.baz
class: Baz

View File

@@ -1,6 +1,6 @@
print(f' Importing {__name__} '.center(50, '=')) print(f' Importing {__name__} '.center(50, '='))
from .motion import Motion from .foo import Foo
from .my_sub_pkg.hello import HelloWorldSub from .my_sub_pkg.bar import Bar
print(' Done '.center(50, '=')) print(' Done '.center(50, '='))

View File

@@ -0,0 +1,18 @@
from pathlib import Path
from appdaemon.adbase import ADBase
filename = Path(__file__).name
print(f' Importing {filename} '.center(50, '-'))
class Foo(ADBase):
changes: bool = False
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'Done, motion.changes = {Foo.changes}'.center(50, '-'))

View File

@@ -1,14 +0,0 @@
from pathlib import Path
import appdaemon.adbase as ad
print(f' Importing {Path(__file__).name} '.center(50, '-'))
class Motion(ad.ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.changes = False
self.adapi.log(f'Initialized app from {__file__} new line changes: {self.changes}')
print(f'Done, motion.changes = {Motion.changes}'.center(50, '-'))

View File

@@ -0,0 +1,5 @@
print(f' Importing {__name__} '.center(50, '+'))
from .bar import Bar
print(f' Done {__name__} '.center(50, '='))

View File

@@ -0,0 +1,12 @@
from pathlib import Path
from appdaemon.adbase import ADBase
filename = Path(__file__).name
print(f' Importing {filename} '.center(50, '-'))
class Bar(ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.adapi.log(f'Initialized app from {__file__}')
# self.adapi.log(f'CHANGED')

View File

@@ -0,0 +1,12 @@
from pathlib import Path
from appdaemon.adbase import ADBase
filename = Path(__file__).name
print(f' Importing {filename} '.center(50, '-'))
class Baz(ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.adapi.log(f'Initialized app from {__file__}')
# self.adapi.log(f'CHANGED')

View File

@@ -1,8 +0,0 @@
import appdaemon.adbase as ad
class HelloWorldSub(ad.ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.log = self.adapi.log
self.log(f'Initialized app from {__file__}')
# self.log(f'CHANGED')