From fd73458471ff784edaac617e46dffd92a670c3f8 Mon Sep 17 00:00:00 2001 From: sbahling Date: Sun, 21 Oct 2018 18:37:48 +0200 Subject: Fixes --- console.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'console.py') diff --git a/console.py b/console.py index c7f1d2c..4e85497 100644 --- a/console.py +++ b/console.py @@ -78,7 +78,7 @@ class RunningStatusThread(): while True: for obj in self.callbacks: value = self.console.status.field(obj.status_quadlet, - **obj.status_bits, + *obj.status_bits, ) obj.status_callback(value) @@ -103,7 +103,7 @@ class Console(): self.unit.connect('control', self.handle_control) - status_thread = RunningStatusThread(self) # noqa F841 + self.status_thread = RunningStatusThread(self) # noqa F841 @property def status(self): @@ -116,7 +116,7 @@ class Console(): changed = before ^ after - for bit in [i for i, b in enumerate(bits32(changed)) if int(b)]: + for bit in [i for i, b in enumerate(reversed(bits32(changed))) if int(b)]: high = bool(after & (0b1 << bit)) button = self.buttons[index][int(bit)] if button is None: @@ -128,7 +128,7 @@ class Console(): else: button.press() - def handle_control(self, index, before, after): + def handle_control(self, unit, index, before, after): print('{0:02d}: {1:08x} {2:08x}'.format(index, before, after)) -- cgit v1.2.3