add debug info for pixelbuffer to RGB extension

This commit is contained in:
xs5871 2022-09-22 08:17:16 +00:00 committed by Kyle Brown
parent 002a57b3b1
commit 63fd4d9574

View File

@ -5,7 +5,9 @@ from kmk.extensions import Extension
from kmk.handlers.stock import passthrough as handler_passthrough
from kmk.keys import make_key
from kmk.kmktime import PeriodicTimer
from kmk.utils import clamp
from kmk.utils import Debug, clamp
debug = Debug(__name__)
rgb_config = {}
@ -127,6 +129,10 @@ class RGB(Extension):
for pixels in self.pixels:
self.num_pixels += len(pixels)
if debug.enabled:
for n, pixels in enumerate(self.pixels):
debug(f'pixels[{n}] = {pixels.__class__}[{len(pixels)}]')
self.rgbw = bool(len(rgb_order) == 4)
self.hue_step = hue_step