added app_class and governor

This commit is contained in:
2024-12-10 16:11:22 +01:00
parent 6056ac134c
commit 383f8dc893
4 changed files with 38 additions and 10 deletions
+4 -8
View File
@@ -1,12 +1,10 @@
from logger import getLogger
from app_class import AppClass
from config import Config, TriggerTuple, MissingConfig
class Trigger:
def __init__(self, name: str, _config: Config) -> None:
class Trigger(AppClass):
def __init__(self, name: str, _config: Config, testmode: bool = False) -> None:
super().__init__(_config, testmode)
self.name = name
self._config = _config
self.log = getLogger('trigger', loglevel=_config.loglevel.upper())
self.log.info(f'initializing {self.__class__.__name__}')
@property
def config(self) -> TriggerTuple:
@@ -14,5 +12,3 @@ class Trigger:
if _config is None:
raise MissingConfig(f"Trigger {self.name} hasn't been properly configured")
return _config