Ignore OpenRGB errors

This commit is contained in:
Davide Depau 2020-12-08 17:08:36 +01:00
parent 04264c34fe
commit 2374eab240
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import struct
import sys import sys
import threading import threading
import time import time
import traceback
import psutil import psutil
import sensors import sensors
@ -174,11 +175,14 @@ def read_serial(s: serial.Serial):
def set_fridge_lights(on: bool): def set_fridge_lights(on: bool):
client = None client = None
# noinspection PyBroadException
try: try:
client = OpenRGBClient() client = OpenRGBClient()
motherboard = client.get_devices_by_type(DeviceType.MOTHERBOARD)[0] motherboard = client.get_devices_by_type(DeviceType.MOTHERBOARD)[0]
onboard_led_0 = filter(lambda x: x.name == "Onboard LED 0", motherboard.zones).__next__() onboard_led_0 = filter(lambda x: x.name == "Onboard LED 0", motherboard.zones).__next__()
onboard_led_0.set_color(RGBColor(0x00, 0xFF if on else 0x00, 0x00)) onboard_led_0.set_color(RGBColor(0x00, 0xFF if on else 0x00, 0x00))
except Exception:
traceback.print_exc()
finally: finally:
if client is not None: if client is not None:
client.disconnect() client.disconnect()