Page MenuHomedesp's stash

test.py
No OneTemporary

from fusion.device import get_device
from fusion.datatypes import *
dev = get_device()
print(dev.get_version_string())
#set simple effect
#print(dev.set_simple_light_effect(FusionLightData(FusionLightEffect.Wave, 1, 50, FusionLightColor.Random, FusionLightDirection.Right2Left)))
#print(dev.set_simple_light_effect(FusionLightData(FusionLightEffect.Static, 1, 50, FusionLightColor.White, FusionLightDirection.Right2Left)))
#get and set to verify if get is correctly implemented
# load = PictureMatrix.from_bytes(dev.get_custom_light_effect(1))
# print(load)
# dev.set_custom_light_effect(1, load)
#manually set color
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)
dev.set_custom_light_effect(10, mat)
print(dev.set_simple_light_effect(FusionLightData(FusionLightEffect.Custom1+10, 1, 255, FusionLightColor.Random, FusionLightDirection.Left2Right)))
#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
# print(dev.reset())
# print(dev.set_simple_light_effect(FusionLightData(FusionLightEffect.Static, 2, 255, FusionLightColor.White, FusionLightDirection.Up2Down)))

File Metadata

Mime Type
text/x-python
Expires
Fri, Sep 5, 3:36 PM (9 h, 27 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1f/84/dd1aa55bb32e68fcd5d407db2cf8

Event Timeline