Log device errors on init

This commit is contained in:
CPD 2025-03-10 13:52:08 +01:00
parent ea49062d80
commit 81641272ee

View File

@ -27,7 +27,10 @@ class DC2200(LedControlDevice):
# turn off
self.instr.write(f'SOURCE1:CBRightness:BRIGhtness 0')
self.instr.write('OUTPUT1:STATE ON')
for _ in range(10): # print max 10 errors
error = self.instr.query('SYSTem:ERRor?')
if error.startswith('+0'): break
log.error(f"DC2200 device error during initialization: {error}")
def on(self):
self.instr.write(f'SOURCE1:CBRightness:BRIGhtness 100')