diff options
Diffstat (limited to 'console.py')
| -rw-r--r-- | console.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)) |
