diff --git a/vban_cmd/iremote.py b/vban_cmd/iremote.py index 0106462..2caefb6 100644 --- a/vban_cmd/iremote.py +++ b/vban_cmd/iremote.py @@ -110,6 +110,7 @@ class IRemote(metaclass=ABCMeta): cmd += (f".{param}",) return "".join(cmd) + @property @abstractmethod def identifier(self): pass diff --git a/vban_cmd/kinds.py b/vban_cmd/kinds.py index 31d6275..17d13d1 100644 --- a/vban_cmd/kinds.py +++ b/vban_cmd/kinds.py @@ -53,6 +53,14 @@ class KindMapClass(metaclass=SingletonType): def num_bus(self): return sum(self.outs) + @property + def num_strip_levels(self) -> int: + return 2 * self.phys_in + 8 * self.virt_in + + @property + def num_bus_levels(self) -> int: + return 8 * (self.phys_out + self.virt_out) + def __str__(self) -> str: return self.name.capitalize() diff --git a/vban_cmd/macrobutton.py b/vban_cmd/macrobutton.py index 9965897..3817005 100644 --- a/vban_cmd/macrobutton.py +++ b/vban_cmd/macrobutton.py @@ -9,7 +9,7 @@ class MacroButton(IRemote): @property def identifier(self): - return f"button[{self.index}]" + return f"command.button[{self.index}]" @property def state(self) -> bool: diff --git a/vban_cmd/packet.py b/vban_cmd/packet.py index 3d5fc98..94a3141 100644 --- a/vban_cmd/packet.py +++ b/vban_cmd/packet.py @@ -103,12 +103,12 @@ class VbanRtPacket: @property def inputlevels(self) -> tuple: """returns the entire level array across all inputs for a kind""" - return self.strip_levels[0 : (2 * self._kind.phys_in + 8 * self._kind.virt_in)] + return self.strip_levels[0 : self._kind.num_strip_levels] @property def outputlevels(self) -> tuple: """returns the entire level array across all outputs for a kind""" - return self.bus_levels[0 : 8 * self._kind.num_bus] + return self.bus_levels[0 : self._kind.num_bus_levels] @property def stripstate(self) -> tuple: diff --git a/vban_cmd/worker.py b/vban_cmd/worker.py index 0ea4960..72dc9e7 100644 --- a/vban_cmd/worker.py +++ b/vban_cmd/worker.py @@ -141,9 +141,8 @@ class Updater(threading.Thread): self._remote.socks[Socket.response].bind( (socket.gethostbyname(socket.gethostname()), self._remote.port) ) - p_in, v_in = self._remote.kind.ins - self._remote._strip_comp = [False] * (2 * p_in + 8 * v_in) - self._remote._bus_comp = [False] * (self._remote.kind.num_bus * 8) + self._remote._strip_comp = [False] * (self._remote.kind.num_strip_levels) + self._remote._bus_comp = [False] * (self._remote.kind.num_bus_levels) def run(self): """