diff --git a/cpdctrl/led_control_device/impl/thorlabs_dc2200.py b/cpdctrl/led_control_device/impl/thorlabs_dc2200.py index 66189d9..eae231c 100644 --- a/cpdctrl/led_control_device/impl/thorlabs_dc2200.py +++ b/cpdctrl/led_control_device/impl/thorlabs_dc2200.py @@ -31,6 +31,11 @@ class DC2200(LedControlDevice): error = self.instr.query('SYSTem:ERRor?') if error.startswith('+0'): break log.error(f"DC2200 device error during initialization: {error}") + + def __del__(self): + self.off() + self.instr.close() + def on(self): self.instr.write(f'SOURCE1:CBRightness:BRIGhtness 100') diff --git a/cpdctrl/led_control_device/impl/thorlabs_ledd1b.py b/cpdctrl/led_control_device/impl/thorlabs_ledd1b.py index 5780de7..a7a91f2 100644 --- a/cpdctrl/led_control_device/impl/thorlabs_ledd1b.py +++ b/cpdctrl/led_control_device/impl/thorlabs_ledd1b.py @@ -15,6 +15,7 @@ class LEDD1B(LedControlDevice): # self._check_arduino_software() def __del__(self): + self.off() self.arduino.close() def _check_arduino_software(self):