Code test
Code: def main(): args = parse_args() TEMP_SCRIPT = "/home/firefly/Downloads/read_temp.sh" FAN_CONTROL = "/usr/bin/firefly_fan_control" BOARD_MODEL = "ITX-3588J" fan_state = None # 'high' or 'low' while True: temp = get_temperature(TEMP_SCRIPT) if temp is None: time.sleep(args.interval) continue if temp >= args.high_threshold and fan_state != 'high': print(f"[INFO] Temp {temp} ≥ {args.high_threshold} → HIGH fan") kill_old_fan_controls() start_fan(args.high, FAN_CONTROL, BOARD_MODEL) fan_state = 'high' elif temp <= args.low_threshold and fan_state != 'low': print(f"[INFO] Temp {temp} ≤ {args.low_threshold} → LOW fan") kill_old_fan_controls() start_fan(args.low, FAN_CONTROL, BOARD_MODEL) fan_state = 'low' else: print(f"[DEBUG] Temp {temp} — Fan remains {fan_state}") time.sleep(args.interval)if __nam