from app_class import AppClass from config import Config, TriggerTuple, MissingConfig class Trigger(AppClass): def __init__(self, name: str, _config: Config, testmode: bool = False) -> None: super().__init__(_config, testmode) self.name = name @property def config(self) -> TriggerTuple: _config = self._config.get_trigger_by_name(self.name) if _config is None: raise MissingConfig(f"Trigger {self.name} hasn't been properly configured") return _config