Tune key at every location: the key the tracks send must reach each location's FOH (SuperRack) in that location's own Planning Center key

NA works out each location's expected Waves Tune programs (campus_tune) and serves them at /api/tune/<id>; locations
fetch their list, read ProPresenter through Companion's connection, and compare with a MIDI witness on the FOH Mac
(SC FOH now; WS FOH needs the Command Line Tools first). FOH KEY WRONG / FOH GOT NO KEY.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 11:51:09 -04:00
co-authored by Claude Opus 5.5
parent 5d0263a9b9
commit e4a33ff660
9 changed files with 140 additions and 11 deletions
+33
View File
@@ -405,6 +405,39 @@ class TestChecks(unittest.TestCase):
finally:
readiness.LAST.pop("tune_sent", None)
def test_a_location_foh_gets_the_key_its_own_plan_has(self):
"""2026-10-28, every location: the key its tracks send must reach its FOH Mac (SuperRack) - the programs its
songs need come from the hub, worked out from that location's own Planning Center keys."""
import readiness
lib = {"Emaj": 4, "Ebmaj": 7, "Gmaj": 11, "Emin": 16, "OFF | Chromatic": 0}
exp = readiness.campus_tune([{"title": "Owe You Praise", "key": "Eb"}, {"title": "Firm Foundation", "key": "Em"},
{"title": "No key", "key": ""}], lib)
self.assertEqual(exp[readiness.norm("Owe You Praise")]["programs"], [7])
self.assertEqual(exp[readiness.norm("Firm Foundation")]["programs"], [11, 16]) # Emin, or G major (relative)
self.assertEqual(len(exp), 2)
sunday = datetime(2026, 10, 25, 9, 40).timestamp()
chk = {"type": "tune_rx", "host": "sc_foh", "name": "FOH", "expect": "hub", "prop_conn": "Propresenter-API"}
ctx = {"now": sunday, "any_recording": False, "autofix_windows": CONFIG["auto_fix"]["windows"]}
readiness.LAST["tune_sent"] = {"OWE YOU PRAISE": {"clip": "Emaj", "program": 4, "title": "Owe You Praise"}} # NA's own key
try:
self.snap.tune_expect = dict(exp, _plan={"id": 1})
self.snap.prop_song = {"name": "Owe You Praise", "since": sunday - 20, "changes": 3}
self.snap.witness = {"sc_foh": {"read": sunday, "pcs": [[sunday - 18, "Network SC FOH", 1, 7]]}}
self.assertEqual(sp.check_tune_rx(chk, self.snap, ctx)[0][1].info, "FOH KEY EB") # SC sings it in Eb
self.snap.witness["sc_foh"]["pcs"] = [[sunday - 18, "Network SC FOH", 1, 4]] # NA's E arrived
r = sp.check_tune_rx(chk, self.snap, ctx)[0][1]
self.assertEqual(r.msg, "FOH KEY WRONG")
self.assertIn("should get Ebmaj (program 7)", r.info)
finally:
readiness.LAST.pop("tune_sent", None)
self.snap.tune_expect = None
def test_a_location_reaches_its_prop_through_companion(self):
self.snap.conn_hosts["Propresenter-API"] = "127.0.0.1"
self.snap.conn_info["Propresenter-API"] = {"module": "renewedvision-propresenter-api", "port": 49285}
self.assertEqual(sp.tune_location_inputs(self.snap, {"prop_conn": "Propresenter-API"}, "ws"), "http://127.0.0.1:49285")
self.assertEqual(sp.tune_location_inputs(self.snap, {}, "ws"), "")
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."""