15 lines
493 B
Python
15 lines
493 B
Python
from app_class import AppClass
|
|
from config import Config, TriggerTuple, MissingConfig
|
|
|
|
class Trigger(AppClass):
|
|
def __init__(self, name: str, _config: Config) -> None:
|
|
super().__init__(_config)
|
|
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
|