+ from lib.datatypes import PictureMatrix, RGB, FusionLightData, FusionLightEffect, FusionLightColor, FusionLightDirection
from lib.device import get_device
-except ImportError:
- from .lib.datatypes import * #as a module
+except ImportError: #as a module
+ from .lib.datatypes import PictureMatrix, RGB, FusionLightData, FusionLightEffect, FusionLightColor, FusionLightDirection
from .lib.device import get_device
from cv2.typing import MatLike
+from typing import List
import sys, cv2, time, numpy, atexit
#10 is actually not transient - it is persistent as a secondary profile but for our purposes we can treat it as transient
#since nobody should have the need to write to a profile number this high (switching between profiles require os interaction anyways so might as well write a new image)
#change to profile for the image stream first (technically only need to change if not transient and current profile is non custom, but we revert afterwards anyway)
#to avoid any flashing set to black first (mainly when we are in simple modes which means last seen image will be shown right when set_simple_light_effect is called)
dev.set_custom_light_effect(profile, PictureMatrix([RGB(0,0,0) for i in range(105)]))
#need to set it to one of the "proper" profiles for it to know to update
mat = PictureMatrix([RGB(70, 255, 170) for i in range(105)]) #seems like the rgb algo in the keyboard firmware really sucks - this value seems more true white than anything (edit: it's actually known in the driver and has special cases)
#test reset (seems like after reset if we set the light effect to custom profiles without data it would crash? not if we immediately set the profile afterwards tho)
#also seems like if we change profiles right(? seems to last longer than 100ms for sure) after reset some data (e.g wave direction and speed) would get reset