Ping the Shure receivers at the address Companion has for them
A power-off test today took 18-27 s to show on RF (Companion's Shure modules' own timeout). Each Axient, ULXD and PSM receiver is now pinged every 3 s: "AXIENT 1 NO PING" in about 6-9 s. A ping check may name a Companion "conn"; its address is read from Companion's settings database (read-only, every 60 s), with "host" as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -251,6 +251,36 @@ class TestChecks(unittest.TestCase):
|
||||
finally:
|
||||
stop.set()
|
||||
|
||||
def test_shure_receivers_are_pinged_at_companions_address(self):
|
||||
chk = {"type": "ping", "conn": "Axient_1", "host": "10.1.1.101", "name": "AXIENT 1"}
|
||||
self.assertEqual(sp.ping_target(chk, self.snap), "10.1.1.101") # fallback
|
||||
self.snap.conn_hosts = {"Axient_1": "10.1.1.201"} # moved in Companion
|
||||
self.assertEqual(sp.ping_target(chk, self.snap), "10.1.1.201")
|
||||
self.assertIn("10.1.1.201", sp.ping_hosts(CONFIG, self.snap))
|
||||
self.snap.ping["10.1.1.201"] = 2
|
||||
self.assertEqual(sp.check_ping(chk, self.snap, self.ctx)[0][1].msg, "AXIENT 1 NO PING")
|
||||
# every Shure receiver has one, and the RF group says which
|
||||
self.snap.conn_hosts = {}
|
||||
self.snap.ping["10.1.1.105"] = 3
|
||||
tiles, _ = run_steps(sp.Engine(CONFIG), self.snap, self.now, 4)
|
||||
self.assertEqual(tiles["rf"]["x"], "RF\nPSM 3 NO PING")
|
||||
|
||||
def test_companion_conn_hosts_reads_its_database_read_only(self):
|
||||
import sqlite3
|
||||
d = tempfile.mkdtemp()
|
||||
path = os.path.join(d, "db.sqlite")
|
||||
db = sqlite3.connect(path)
|
||||
db.execute("CREATE TABLE instances (id STRING, value STRING)")
|
||||
rows = [("a", {"label": "Axient_1", "config": {"host": "10.1.1.101", "port": 2202}}),
|
||||
("b", {"label": "OBS-Youtube", "config": {"host": " 10.1.9.126 "}}),
|
||||
("c", {"label": "no-host", "config": {}}), ("d", "not json")]
|
||||
db.executemany("INSERT INTO instances VALUES (?, ?)",
|
||||
[(i, v if isinstance(v, str) else json.dumps(v)) for i, v in rows])
|
||||
db.commit()
|
||||
db.close()
|
||||
self.assertEqual(sp.companion_conn_hosts(path), {"Axient_1": "10.1.1.101", "OBS-Youtube": "10.1.9.126"})
|
||||
self.assertEqual(sp.companion_conn_hosts(os.path.join(d, "missing.sqlite")), {})
|
||||
|
||||
def test_fx_lights_midi_on_the_tracks_mac(self):
|
||||
engine = sp.Engine(CONFIG)
|
||||
self.assertEqual(engine.step(self.snap, self.now)["midi"]["x"], "MIDI\nOK") # not read yet: no verdict
|
||||
|
||||
Reference in New Issue
Block a user