Resi: checks keep quiet while a Resi event starts or stops (weekly schedule + PCO special services)

User 2026-10-26: three services each have a Resi event that starts and stops on its own; the cloud,
decoder and Resi audio checks threw false alarms then. resi_events (weekly, from studio.resi.io) and the
special services' times from PCO; checks marked quiet resi_events show OK (EVENT CHANGE) within 10 min of
an event's start or end. The encoder's ping and web checks still alarm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 12:37:00 -04:00
co-authored by Claude Opus 5.5
parent 8b9a71eba0
commit aa90f7e03c
5 changed files with 149 additions and 7 deletions
+18
View File
@@ -359,6 +359,24 @@ class TestChecks(unittest.TestCase):
tiles, _ = run_steps(sp.Engine(CONFIG), self.snap, self.now, 4)
self.assertNotEqual(level(tiles["resi"]), "err")
def test_resi_quiet_while_an_event_starts_or_stops(self):
"""2026-10-26: the Resi cloud / decoder checks threw false alarms at every Resi event change."""
sunday = datetime(2026, 10, 25, 9, 0).timestamp()
self.assertFalse(sp.resi_quiet(CONFIG, sunday)) # between 7:30-9:15's margins
self.assertTrue(sp.resi_quiet(CONFIG, sunday + 14 * 60)) # 9:14, the 9:15 end
self.assertTrue(sp.resi_quiet(CONFIG, sunday + 38 * 60)) # 9:38, the 9:30 start
tuesday = datetime(2026, 11, 3, 18, 35).timestamp()
self.assertFalse(sp.resi_quiet(CONFIG, tuesday))
import readiness
readiness.LAST["resi_specials"] = [(datetime(2026, 11, 3, 18, 30).timestamp(), datetime(2026, 11, 3, 21, 0).timestamp())]
try:
self.assertTrue(sp.resi_quiet(CONFIG, tuesday)) # First Tuesday from PCO
finally:
readiness.LAST.pop("resi_specials", None)
self.snap.conns["resi-studio-cues"] = {"id": "r", "enabled": True, "category": "error", "message": "boom"}
tiles, _ = run_steps(sp.Engine(CONFIG), self.snap, sunday + 38 * 60, 4)
self.assertEqual(tiles["resi"]["x"], "RESI\nEVENT CHANGE")
def test_resi_audio_silent(self):
"""An input stuck at the meter floor (2026-10-25: the Resi AJA passed no Dante audio and nothing said so):
red while a deck records (a service is on); between services the Resi send is quiet on purpose."""