check vban direction

check that index is numeric

remove button as possible key.
not defined in RT packets anyway

patch bump
This commit is contained in:
onyx-and-iris 2023-08-10 21:24:59 +01:00
parent f9bcbfa74a
commit 79260a0e47
4 changed files with 13 additions and 4 deletions

View File

@ -94,6 +94,7 @@ def main():
{ {
"strip-2": {"A1": True, "B1": True, "gain": -6.0}, "strip-2": {"A1": True, "B1": True, "gain": -6.0},
"bus-2": {"mute": True, "eq": {"on": True}}, "bus-2": {"mute": True, "eq": {"on": True}},
"vban-in-0": {"on": True},
} }
) )
@ -355,6 +356,7 @@ vban.apply(
"strip-0": {"A1": True, "B1": True, "gain": -6.0}, "strip-0": {"A1": True, "B1": True, "gain": -6.0},
"bus-1": {"mute": True, "mode": "composite"}, "bus-1": {"mute": True, "mode": "composite"},
"bus-2": {"eq": {"on": True}}, "bus-2": {"eq": {"on": True}},
"vban-in-0": {"on": True},
} }
) )
``` ```

View File

@ -37,6 +37,7 @@ def main():
{ {
"strip-2": {"A1": True, "B1": True, "gain": -6.0}, "strip-2": {"A1": True, "B1": True, "gain": -6.0},
"bus-2": {"mute": True}, "bus-2": {"mute": True},
"vban-in-0": {"on": True},
} }
) )

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "vban-cmd" name = "vban-cmd"
version = "2.4.7" version = "2.4.8"
description = "Python interface for the VBAN RT Packet Service (Sendtext)" description = "Python interface for the VBAN RT Packet Service (Sendtext)"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -184,10 +184,16 @@ class VbanCmd(metaclass=ABCMeta):
def target(key): def target(key):
match key.split("-"): match key.split("-"):
case ["strip" | "bus" | "button" as kls, index]: case ["strip" | "bus" as kls, index] if index.isnumeric():
target = getattr(self, kls) target = getattr(self, kls)
case ["vban", direction, index]: case [
target = getattr(self.vban, f"{direction.rstrip('stream')}stream") "vban",
"in" | "instream" | "out" | "outstream" as direction,
index,
] if index.isnumeric():
target = getattr(
self.vban, f"{direction.removesuffix('stream')}stream"
)
case _: case _:
ERR_MSG = f"invalid config key '{key}'" ERR_MSG = f"invalid config key '{key}'"
self.logger.error(ERR_MSG) self.logger.error(ERR_MSG)