"""A/B test: does sending frames faster make the Eve 1800 dimmer? Run with SignalRGB fully closed. Each step shows full white for a few seconds at a different update rate; press Enter to move on and type how bright it looked (1 = barely lit, 5 = full brightness). Results go to brightness_ab.json. """ import json import pathlib import time import eve OUT = pathlib.Path(__file__).with_name("brightness_ab.json") WHITE = [(255, 255, 255)] * 10 STEPS = [ ("single frame, then nothing", 0), ("2 frames/sec (static-effect keep-alive)", 2), ("10 frames/sec", 10), ("33 frames/sec (SignalRGB animated effect)", 33), ] def run_step(fps, seconds=6): packets = eve.build_packets(WHITE) dev = eve.open_device() dev.set_nonblocking(True) try: end = time.monotonic() + seconds while True: for p in packets: dev.write(p) while dev.read(eve.REPORT_LEN): pass if not fps or time.monotonic() >= end: break time.sleep(1 / fps) if not fps: time.sleep(seconds) finally: dev.close() def main(): results = {} for label, fps in STEPS: input(f"\nNext: {label}. Watch the keyboard and press Enter...") print(" showing white for 6 seconds...") run_step(fps) results[label] = input(" How bright was it, 1-5 (add notes if you like)? ").strip() OUT.write_text(json.dumps(results, indent=2)) print(f"\nSaved to {OUT}") if __name__ == "__main__": main()