Audio failover: press FOH Backup by itself when Studio B dies; Companion button presses as fixes
A new fix kind "companion_press" presses any Companion button over its HTTP API (page, row, col). A fix marked "failover" runs by itself within seconds of its check failing: inside the "failover" windows (Sunday 06:30-13:30), even while ALARMS is muted, once per fault, never back the other way. The hidden STB AUDIO key (inside AUDIO) watches Studio B's ping every second, Pro Tools over SSH every 2 s and its Dante device; each check's fix is the FOH Backup press. The keys say ON FOH BACKUP until STREAM STB on the Restart page switches back. Settings page: the press builder, the failover tick and undo, the Failover calendar, help entry "A fallback button". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+22
-1
@@ -35,7 +35,7 @@ class TestTodaysFixes(unittest.TestCase):
|
||||
if c.get("template"):
|
||||
self.assertEqual(b.build_check(CFG, c)["cmd"], c["cmd"])
|
||||
n += 1
|
||||
self.assertEqual(n, 5)
|
||||
self.assertEqual(n, 6)
|
||||
|
||||
def test_a_changed_command_is_refused_by_validate(self):
|
||||
cfg = json.loads(json.dumps(CFG))
|
||||
@@ -126,6 +126,27 @@ if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
class TestCompanionPress(unittest.TestCase):
|
||||
def test_a_press_builds_from_its_fields(self):
|
||||
f = b.build(CFG, {"template": "companion_press", "params": {"page": 4, "row": 0, "col": "5", "button": "FOH Backup"}, "short": "FOH BACKUP"})
|
||||
self.assertEqual((f["kind"], f["page"], f["row"], f["col"], f["short"]), ("companion_press", 4, 0, 5, "FOH BACKUP"))
|
||||
self.assertEqual(f["params"]["col"], 5) # copied as a number
|
||||
self.assertNotIn("run", f); self.assertNotIn("host", f)
|
||||
self.assertEqual(b.suggest_label(CFG, f), "press the FOH Backup button in Companion (page 4, row 0, column 5)")
|
||||
self.assertEqual(b.suggest_label(CFG, {"template": "companion_press", "params": {"page": 4, "row": 0, "col": 5}}),
|
||||
"press the button in Companion (page 4, row 0, column 5)")
|
||||
for bad in ({"page": 4, "row": 0}, {"page": "four", "row": 0, "col": 5}, {"page": 4, "row": 1.5, "col": 5},
|
||||
{"page": True, "row": 0, "col": 5}):
|
||||
with self.assertRaises(ValueError):
|
||||
b.build(CFG, {"template": "companion_press", "params": bad})
|
||||
|
||||
def test_a_changed_button_is_caught(self):
|
||||
cfg = json.loads(json.dumps(CFG))
|
||||
cfg["fixes"]["stream_foh_backup"]["col"] = 7 # the field moved, the params did not
|
||||
self.assertTrue(any("stream_foh_backup" in e and "its col no longer matches" in e for e in b.mismatches(cfg)), b.mismatches(cfg))
|
||||
self.assertEqual([e for e in b.mismatches(CFG) if "stream_" in e], [])
|
||||
|
||||
|
||||
class TestOutlet(unittest.TestCase):
|
||||
def test_outlet_cycle_renders_and_is_local(self):
|
||||
f = b.build(CFG, {"template": "outlet_cycle", "params": {"outlet": "tascam", "address": "10.1.11.74", "wait_seconds": 8}})
|
||||
|
||||
Reference in New Issue
Block a user