added some complexity
This commit is contained in:
@@ -10,6 +10,8 @@ simple_app:
|
|||||||
|
|
||||||
Perimeter:
|
Perimeter:
|
||||||
dependencies:
|
dependencies:
|
||||||
- utils
|
- rules
|
||||||
- statemachine
|
- statemachine
|
||||||
- hal
|
- hal
|
||||||
|
module: perimeter
|
||||||
|
class: Perimeter
|
||||||
|
|||||||
@@ -1,2 +1,9 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger('AppDaemon.Perimeter')
|
||||||
|
|
||||||
class HAL:
|
class HAL:
|
||||||
...
|
def __init__(self, *args, **kwargs):
|
||||||
|
self.args = args
|
||||||
|
self.kwargs = kwargs
|
||||||
|
logger.info('Logging from HAL')
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
class Rule1:
|
|
||||||
...
|
|
||||||
|
|
||||||
class Rule2:
|
|
||||||
...
|
|
||||||
@@ -1,2 +1,8 @@
|
|||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger('AppDaemon.Perimeter')
|
||||||
|
logger.info('Imported statemachine')
|
||||||
|
|
||||||
|
|
||||||
class StateMachine:
|
class StateMachine:
|
||||||
...
|
...
|
||||||
|
|||||||
11
conf/apps/deep/arbitrary/rules.py
Normal file
11
conf/apps/deep/arbitrary/rules.py
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Rule1:
|
||||||
|
state: str
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Rule2:
|
||||||
|
value: int
|
||||||
|
other: str = "default" # test changing this
|
||||||
13
conf/apps/perimeter.py
Normal file
13
conf/apps/perimeter.py
Normal file
@@ -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}')
|
||||||
Reference in New Issue
Block a user