SC Lighting PC joined: VISTA key and Restart key, rtpMIDI watched on MIDI

- a helper program (rtpMIDI) on a computer that joins after the MIDI key exists is added to it
  (it was marked seen and never added)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 14:10:42 -04:00
co-authored by Claude Opus 5.5
parent a54b6b6276
commit 176e8e9073
3 changed files with 126 additions and 1 deletions
+15
View File
@@ -351,6 +351,7 @@ def items(inv, nets):
home["checks"] += it["checks"]
home["fixes"].update(it["fixes"])
home["also"].append(it["ident"])
home.setdefault("folded", {})[it["ident"]] = {"checks": it["checks"], "fixes": it["fixes"], "label": it["label"]}
out.remove(it)
return out, hosts
@@ -561,6 +562,20 @@ def merge_parts(cfg, it, fresh):
wired_at += 1
words.append("MIDI link %s" % c["peer"])
cfg["fixes"].setdefault("midi_reconnect", dict(SHARED_FIXES["midi_reconnect"]))
# A helper program found later (Southcoast's Lighting PC joined after its MIDI key existed: rtpMIDI was
# marked seen but never added, 2026-10-21) joins the key it rides in.
for ident, part in (it.get("folded") or {}).items():
if ident not in fresh:
continue
home = next((t for t in cfg["tiles"] if any(c.get("type") == "midi_wired" for c in t.get("checks", []))), None) \
if it["ident"] == "midi_wired" else None
if home is None:
continue
at = next((i for i, c in enumerate(home["checks"]) if c.get("type") == "midi_wired"), len(home["checks"]))
home["checks"][at:at] = [c for c in part["checks"] if c not in home["checks"]]
for fid, f in part["fixes"].items():
cfg["fixes"].setdefault(fid, f)
words.append("%s checks on the %s key" % (key_text(part["label"]), home["label"]))
return words