pynenc.trigger.trigger_context¶
Context for trigger evaluation in Pynenc.
This module defines the TriggerContext class which collects valid conditions and provides access to their contexts for trigger evaluation.
Module Contents¶
Classes¶
Context for trigger evaluation. |
Data¶
API¶
- pynenc.trigger.trigger_context.C¶
‘TypeVar(…)’
- class pynenc.trigger.trigger_context.TriggerContext(timestamp: datetime.datetime | None = None, valid_conditions: dict[str, pynenc.trigger.conditions.ValidCondition] | None = None)[source]¶
Context for trigger evaluation.
Contains a collection of valid conditions (satisfied conditions with their contexts), which are used to evaluate whether a trigger definition should execute.
Initialization
Initialize the trigger context.
- Parameters:
timestamp – Time of context creation, defaults to current time
valid_conditions – Dictionary of initial valid conditions, if any
- static build_conditions_dict(valid_conditions: dict[str, pynenc.trigger.conditions.ValidCondition]) dict[str, pynenc.trigger.conditions.TriggerCondition][source]¶
Build a mapping from condition IDs to condition objects.
- Parameters:
valid_conditions – Dictionary of valid conditions
- Returns:
Dictionary mapping condition IDs to their condition objects