Skip to content

Instantly share code, notes, and snippets.

@henryxwong
henryxwong / gist:766971bd782cad46166991d19b7bd807
Last active June 30, 2026 15:11
CPU Temp -> RGB LED Controller for ZettLab
#!/usr/bin/env python3
"""CPU temperature -> RGB LED control via rgb_control.py.
Reads CPU die temperature from Netdata (24h + 30d).
Combines both windows for accurate min/max range:
- min = min(24h_min, 30d_min) — never miss cool temps
- max = max(24h_max, 30d_max) — capture peaks even if smoothed
Maps current temp to a blue-to-red color gradient with intensity scaling.
"""