From f13ea041dd6ac7ba9c71949509db268cde23d341 Mon Sep 17 00:00:00 2001 From: Florian Rau Date: Tue, 31 Oct 2023 12:33:17 +0000 Subject: [PATCH] Update hardware.py --- iblrig/hardware.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iblrig/hardware.py b/iblrig/hardware.py index b7d3b1908..e7f87fb51 100644 --- a/iblrig/hardware.py +++ b/iblrig/hardware.py @@ -185,11 +185,12 @@ def set_status_led(self, state: bool) -> bool: log.info(f'{"en" if state else "dis"}abling Bpod Status LED') command = struct.pack("cB", b":", state) self._arcom.serial_object.write(command) - return self._arcom.serial_object.read(1) + if self._arcom.read_uint8() == 1: + return True except serial.SerialException: self._arcom.serial_object.flush() log.error('Bpod device does not support control of the status LED. Please update firmware.') - self.set_status_led.supported = False + self.set_status_led.supported = False return False def valve(self, valve_id: int, state: bool):