MIDI key: every network MIDI peer must come over the wired network
The Macs are also on Wi-Fi and the Dante networks, and Bonjour lists each MIDI session once per network. ProdDash's Vista Cues module had Tracks and Companion set to their Wi-Fi addresses, so lighting MIDI rode Wi-Fi. A midi_wired check now names any peer, in NA Ingest's session or the other Macs', whose address is outside the wired network (10.1.0.0/16 at NA). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ must be declared here, every default in the code must equal the one here).
|
||||
Paths: "companion.host", "tiles[].checks[].conn" (a list element), "fixes.*.run" (a map entry).
|
||||
"""
|
||||
import copy
|
||||
import ipaddress
|
||||
import re
|
||||
|
||||
import status_panel as sp
|
||||
@@ -298,6 +299,7 @@ field("tiles[].checks[].warn_gb", "int", 20, "Amber below this many GB free.", "
|
||||
field("tiles[].checks[].err_gb", "int", 5, "Red below this many GB free.", "Keys", advanced=True)
|
||||
field("tiles[].checks[].session", "str", None, "The network MIDI session.", "Keys")
|
||||
field("tiles[].checks[].peer", "str", None, "The peer that must be in it.", "Keys")
|
||||
field("tiles[].checks[].nets", "list", None, "The wired network(s) every MIDI peer must come over, e.g. 10.1.0.0/16.", "Keys")
|
||||
field("tiles[].checks[].address", "str", None, "Where to reconnect the peer if it was never seen.", "Keys", advanced=True)
|
||||
field("tiles[].checks[].domain", "str", None, "The macOS preference domain.", "Keys")
|
||||
field("tiles[].checks[].key", "str", None, "The preference key.", "Keys")
|
||||
@@ -423,6 +425,8 @@ CHECKS = {
|
||||
"question": "Is a setting right?", "words": "Free space on a disk."},
|
||||
"midi_peer": {"fields": ["session", "peer", "host", "address"], "subs": ["peer"], "identity": ["host", "session", "peer"],
|
||||
"module": None, "question": "Is a MIDI link up?", "words": "A peer is in a network MIDI session (here or on another Mac)."},
|
||||
"midi_wired": {"fields": ["nets"], "subs": ["wired", "<host|session|peer>"], "identity": [], "module": None,
|
||||
"question": "Is a MIDI link up?", "words": "Every network MIDI peer comes over the wired network (not Wi-Fi or Dante)."},
|
||||
"pref": {"fields": ["domain", "key", "want", "msg", "template", "params"], "subs": ["pref"], "identity": ["domain", "key"],
|
||||
"module": None, "question": "Is a setting right?", "words": "A macOS preference has the value it should."},
|
||||
"spotify": {"fields": ["playlist", "fix"], "subs": ["spotify"], "identity": [], "module": None,
|
||||
@@ -611,6 +615,16 @@ def validate(cfg, live=None):
|
||||
errors.append("%s: a ping needs an address or a connection" % cw)
|
||||
if c["type"] == "midi_peer" and not (c.get("session") and c.get("peer")):
|
||||
errors.append("%s: a MIDI link needs a session and a peer" % cw)
|
||||
if c["type"] == "midi_wired":
|
||||
nets = c.get("nets")
|
||||
if not (isinstance(nets, list) and nets):
|
||||
errors.append("%s: a wired-MIDI check needs the wired network(s), e.g. 10.1.0.0/16" % cw)
|
||||
else:
|
||||
for n in nets:
|
||||
try:
|
||||
ipaddress.ip_network(str(n), strict=False)
|
||||
except ValueError:
|
||||
errors.append("%s: %r is not a network (like 10.1.0.0/16)" % (cw, n))
|
||||
if c["type"] == "remote" and not (c.get("host") and c.get("cmd") and c.get("msg")):
|
||||
errors.append("%s: a remote check needs a computer, a command and the words to show" % cw)
|
||||
fx = c.get("fix")
|
||||
|
||||
Reference in New Issue
Block a user