diff --git a/stats-sender/stats_sender.py b/stats-sender/stats_sender.py index d5a54d5..974dfa5 100644 --- a/stats-sender/stats_sender.py +++ b/stats-sender/stats_sender.py @@ -6,6 +6,7 @@ import struct import sys import threading import time +import traceback import psutil import sensors @@ -174,11 +175,14 @@ def read_serial(s: serial.Serial): def set_fridge_lights(on: bool): client = None + # noinspection PyBroadException try: client = OpenRGBClient() 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.set_color(RGBColor(0x00, 0xFF if on else 0x00, 0x00)) + except Exception: + traceback.print_exc() finally: if client is not None: client.disconnect()