NA's page keys name the other locations with a problem in a blue band; PROP OUT reads Chronicles

- campuses.remote_summary -> custom variable sp_remote; band flashes until acknowledged there, steady after, "SC?" when silent
- nav_locations_band (NA only); red stays for NA's own problems
- PROP OUT: /Volumes/Location Assets/{date} on NA ProP (Chronicles share)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 14:57:45 -04:00
co-authored by Claude Opus 5.5
parent ee7326a6eb
commit 48a754a118
8 changed files with 81 additions and 4 deletions
+24
View File
@@ -578,3 +578,27 @@ class TestHelperJoinsLater(unittest.TestCase):
self.assertTrue(any((c.get("params") or {}).get("exe") == "rtpMIDI.exe" for c in midi["checks"]), added)
self.assertTrue(any("RTPMIDI" in a for a in added), added)
self.assertEqual(schema.validate(new)[0], [])
class TestLocationsBand(unittest.TestCase):
"""NA's page keys name the other locations with a problem in blue; red stays NA's own (2026-10-21)."""
def test_the_summary_names_locations_down_and_flashes_until_acknowledged(self):
from settings import campuses as cv
now = 1000.0
st = lambda x, b, b2: {"hb": now - 1, "state": json.dumps({"all": {"x": x, "b": b, "b2": b2}})}
remote = {"ws": st("ALL OK", 1, 1), "sc": st("2 DOWN\nPROP LIGHTS", 0xFF0000, 0)}
self.assertEqual(cv.remote_summary(["sc", "ws", "ab"], remote, now), {"t": 1000, "n": 2, "x": "AB? SC", "f": 1})
remote["sc"] = st("1 DOWN\nX", 0x8B0000, 0x8B0000) # acknowledged at SC: steady
self.assertEqual(cv.remote_summary(["sc", "ws"], remote, now), {"t": 1000, "n": 1, "x": "SC", "f": 0})
remote["sc"] = dict(remote["sc"], hb=now - 60) # stopped answering
self.assertEqual(cv.remote_summary(["sc"], remote, now)["x"], "SC?")
def test_only_a_page_key_set_for_it_carries_the_band(self):
na = json.load(open(os.path.join(ROOT, "config.json")))
names = lambda cfg: [l.get("name") for l in make_page.nav_key("pagenum", cfg["variables"], 19, cfg=cfg)["style"]["layers"]]
self.assertIn("Locations", names(dict(na, nav_locations_band=True)))
self.assertNotIn("Locations", names(dict(na, nav_locations_band=False)))
band = [l for l in make_page.nav_key("pagenum", na["variables"], 19, cfg=dict(na, nav_locations_band=True))["style"]["layers"]
if l.get("name") == "Locations"][0]
self.assertNotIn(str(0xFF0000), json.dumps(band)) # never red