From 8663aab2cecf027a431d2bdd764fe1ed2ce07bcb Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:40:32 +0100 Subject: [PATCH] add fget() to level getters in strip, bus --- vban_cmd/bus.py | 7 +++++-- vban_cmd/strip.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/vban_cmd/bus.py b/vban_cmd/bus.py index 4cb8bd6..c6633c1 100644 --- a/vban_cmd/bus.py +++ b/vban_cmd/bus.py @@ -74,13 +74,16 @@ class BusLevel(IRemote): def getter(self): """Returns a tuple of level values for the channel.""" + def fget(i): + return round((((1 << 16) - 1) - i) * -0.01, 1) + if self._remote.running and self._remote.event.ldirty: return tuple( - round(i * -0.01, 1) + fget(i) for i in self._remote.cache["bus_level"][self.range[0] : self.range[-1]] ) return tuple( - round(i * -0.01, 1) + fget(i) for i in self._remote._get_levels(self.public_packet)[1][ self.range[0] : self.range[-1] ] diff --git a/vban_cmd/strip.py b/vban_cmd/strip.py index 052e529..e1e13b5 100644 --- a/vban_cmd/strip.py +++ b/vban_cmd/strip.py @@ -105,15 +105,18 @@ class StripLevel(IRemote): def getter(self): """Returns a tuple of level values for the channel.""" + def fget(i): + return round((((1 << 16) - 1) - i) * -0.01, 1) + if self._remote.running and self._remote.event.ldirty: return tuple( - round(i * -0.01, 1) + fget(i) for i in self._remote.cache["strip_level"][ self.range[0] : self.range[-1] ] ) return tuple( - round(i * -0.01, 1) + fget(i) for i in self._remote._get_levels(self.public_packet)[0][ self.range[0] : self.range[-1] ]