diff --git a/conf/apps/apps.yaml b/conf/apps/apps.yaml index e135ad9..f3a4618 100644 --- a/conf/apps/apps.yaml +++ b/conf/apps/apps.yaml @@ -10,6 +10,8 @@ simple_app: Perimeter: dependencies: - - utils + - rules - statemachine - hal + module: perimeter + class: Perimeter diff --git a/conf/apps/deep/arbitrary/path/hal.py b/conf/apps/deep/arbitrary/path/hal.py index c331a4c..64ea74a 100644 --- a/conf/apps/deep/arbitrary/path/hal.py +++ b/conf/apps/deep/arbitrary/path/hal.py @@ -1,2 +1,9 @@ +import logging + +logger = logging.getLogger('AppDaemon.Perimeter') + class HAL: - ... \ No newline at end of file + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + logger.info('Logging from HAL') diff --git a/conf/apps/deep/arbitrary/path/rules.py b/conf/apps/deep/arbitrary/path/rules.py deleted file mode 100644 index 59f68fe..0000000 --- a/conf/apps/deep/arbitrary/path/rules.py +++ /dev/null @@ -1,5 +0,0 @@ -class Rule1: - ... - -class Rule2: - ... diff --git a/conf/apps/deep/arbitrary/path/statemachine.py b/conf/apps/deep/arbitrary/path/statemachine.py index d58adce..3de8f95 100644 --- a/conf/apps/deep/arbitrary/path/statemachine.py +++ b/conf/apps/deep/arbitrary/path/statemachine.py @@ -1,2 +1,8 @@ +import logging + +logger = logging.getLogger('AppDaemon.Perimeter') +logger.info('Imported statemachine') + + class StateMachine: ... diff --git a/conf/apps/deep/arbitrary/rules.py b/conf/apps/deep/arbitrary/rules.py new file mode 100644 index 0000000..6bdaa72 --- /dev/null +++ b/conf/apps/deep/arbitrary/rules.py @@ -0,0 +1,11 @@ +from dataclasses import dataclass + + +@dataclass +class Rule1: + state: str + +@dataclass +class Rule2: + value: int + other: str = "default" # test changing this diff --git a/conf/apps/perimeter.py b/conf/apps/perimeter.py new file mode 100644 index 0000000..1803590 --- /dev/null +++ b/conf/apps/perimeter.py @@ -0,0 +1,13 @@ +from appdaemon.adapi import ADAPI + +import hal +import statemachine +import rules + + +class Perimeter(ADAPI): + def initialize(self): + self.hal = hal.HAL('arg4') + self.rules = rules.Rule1('abc'), rules.Rule2(123) + self.log(f'Initialized perimeter: {self.hal.args}') + self.log(f'Rules: {self.rules}')