#seems like profile can be anything (just that outside of 0-4 it doesnt persist?)
#edit: so apparently profiles outside of 0-4 (at least up until 255) actually persists and is accessible, just that on a reboot it will assume the data doesnt exist
#switching to another profile and then switching back would still work
#aka the profile restriction only exists in set_simple_light_effect
# if profile not in range(5):
# raise TypeError('Invalid profile number!')
buf = bytearray(9)
buf[1] = 0x12
buf[3] = profile
buf[4] = 8 #why? its also always returned by get_custom_light_effect
self.compute_simple_checksum(buf)
sent = self.h.send_feature_report(buf)
if sent == -1:
raise IOError(self.h.error())
data = pixels.to_bytes(adjust)
for split in [data[i:i+64] for i in range(0, len(data), 64)]:
self.h.write(b'\0' + split)
#writing all at once would just freeze the keyboard
#self.h.write(b'\0' + b'\0'.join([data[i:i+64] for i in range(0, len(data), 64)]))
#aka LoadPictureMatrixValue
#use PictureMatrix.from_bytes to convert it back into a usable PictureMatrix