diff --git a/meshai/central/wfigs_handler.py b/meshai/central/wfigs_handler.py index 6523cb9..2b0884a 100644 --- a/meshai/central/wfigs_handler.py +++ b/meshai/central/wfigs_handler.py @@ -274,6 +274,7 @@ def _attach_commit_handles(data: Optional[dict], *, irwin_id: str, data["_on_broadcast_committed"] = _on_commit data["_broadcast_audit"] = {"table": "fires", "pk": irwin_id} + data["_cooldown_suffix"] = irwin_id # ---------- helpers ------------------------------------------------------- diff --git a/meshai/notifications/pipeline/dispatcher.py b/meshai/notifications/pipeline/dispatcher.py index d6ee8e0..f56b640 100644 --- a/meshai/notifications/pipeline/dispatcher.py +++ b/meshai/notifications/pipeline/dispatcher.py @@ -360,10 +360,14 @@ class Dispatcher: # ---------- Section 2 — per-toggle cooldown ---------- cooldown_s = int(getattr(tog, "cooldown_seconds", 300) or 0) if cooldown_s > 0: + suffix = (event.data or {}).get("_cooldown_suffix", "") + region_key = event.region or "*" + if suffix: + region_key = f"{region_key}|{suffix}" ck = ( getattr(tog, "name", "") or fam, event.category, - event.region or "*", + region_key, ) now = time.time() last_fired = self._toggle_cooldown.get(ck)