threshold_duration.evaluate()
Trigger only after enough covered time satisfies a threshold rule.
Usage
threshold_duration.evaluate(
animal_id,
window_readings,
now,
config,
)Config keys: - threshold_c: float - direction: “below” or “above”, default “below” - required_duration_seconds: float - min_samples: int - min_coverage_fraction: float, default 1.0 - coverage_tolerance_seconds: float, default 1.0 - aggregation: “mean”, “all”, or “fraction” - min_fraction_true: float, used when aggregation=“fraction”