Restart keys flash when their thing is down; Ableton reopens its last set

- A Restart page key flashes red "HOLD TO FIX" while any check that its
  fix (or a fix/connection in its "watch") covers is down, e.g. DVS
  TRACKS when DANTE misses NA-Tracks.
- Ableton's start and restart reopen the set Live last opened (read from
  its Log.txt before quitting; templates skipped) instead of the default
  template. Tested live: ABLETON and TRANSLATE restart keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 18:57:04 -04:00
co-authored by Claude Opus 5.5
parent a2a2e40b15
commit 0b38e9247b
4 changed files with 58 additions and 10 deletions
+25
View File
@@ -863,6 +863,23 @@ class Engine:
plan.append((ident, "restart", chk["conn"], chk))
return plan
def failing_targets(self):
"""(fix ids, Companion connections) of every check that is down right now: a Restart page
key whose fix (or a fix/connection in its "watch") is among them flashes."""
fixes, conns = set(), set()
for key, tr in self.trackers.items():
if not tr.confirmed or tr.result.level != ERR or key not in self.meta:
continue
_, chk, sub = self.meta[key]
fix_id = chk.get("fix")
if isinstance(fix_id, dict):
fix_id = fix_id.get(sub, fix_id.get("*"))
if fix_id:
fixes.add(fix_id)
if chk.get("conn"):
conns.add(chk["conn"])
return fixes, conns
def failing(self, tile_id):
"""Is anything on this button (or its members) in a confirmed fault right now?"""
for key in self.keys_for(tile_id):
@@ -1062,10 +1079,15 @@ def colored(text, level):
def render(engine, service_on):
out = {}
down_fixes, down_conns = engine.failing_targets()
for kid, key in engine.restart_keys.items():
note = engine.notes.get(kid)
watch = [key["fix"]] + key.get("watch", [])
down = any(w[5:] in down_conns if w.startswith("conn:") else w in down_fixes for w in watch)
if note and engine.now < note["until"]:
out[kid] = colored(key["label"] + "\n" + note["text"], note["level"])
elif down: # flashes: this is the one to hold
out[kid] = colored(key["label"] + "\nHOLD TO FIX", "err")
else:
out[kid] = colored(key["label"] + "\nHOLD 2s", "idle")
for tile in engine.cfg["tiles"]:
@@ -1697,6 +1719,9 @@ def load_config(path):
raise ValueError("restart key %s has a tile's id" % k["id"])
if k["fix"] not in cfg.get("fixes", {}):
raise ValueError("restart key %s: unknown fix %s" % (k["id"], k["fix"]))
for w in k.get("watch", []):
if not w.startswith("conn:") and w not in cfg.get("fixes", {}):
raise ValueError("restart key %s: unknown fix %s in watch" % (k["id"], w))
return cfg