"""Calibration: strips 2 and 6 only. First 10 green, then alternating 10 blue / 10 red. 10% brightness.""" BRIGHTNESS = 1 BLOCK = 10 STRIPS_ON = (2, 6) # 0-based: 3rd and 7th strip only GREEN = (0, 255, 0) RED = (255, 0, 0) BLUE = (0, 0, 255) def _scale(color, factor): return tuple(int(c * factor) for c in color) class Calibration: def __init__(self, driver): self.driver = driver def run(self, preset): strips = self.driver.strips green = _scale(GREEN, BRIGHTNESS) red = _scale(RED, BRIGHTNESS) blue = _scale(BLUE, BRIGHTNESS) blue = (0,0,0) on_set = set(STRIPS_ON) for strip_idx, strip in enumerate(strips): n = strip.num_leds if strip_idx not in on_set: strip.fill((0, 0, 0)) strip.show() continue for i in range(n): if i < BLOCK: strip.set(i, green) else: block = (i - BLOCK) // BLOCK strip.set(i, blue if block % 2 == 0 else red) strip.show()