public static async void run() { demo = true; while (demo) { UpdateLights.addDevice(Names[r.Next(0, Names.Count)], $"{randomValues()},{randomValues()},{randomValues()},{randomValues()},"); Console.WriteLine($"{UpdateLights.NumberOfDevices}, {UpdateLights.StackSize}"); await Task.Delay(AFXCore.UpdateInterval); } }
public async void Update() { if (disable) { return; } List <ILight> lightsUsedNow = new List <ILight>(); for (int i = 0; i < UpdateLights.NumberOfDevices; i++) { LightDevice device = UpdateLights.lightAtIndex(i) as LightDevice; if (lightsUsedNow.Contains(device)) { UpdateLights.pushToStack(device); continue; } Colorize(AFX_Device, device.DeviceID, device.LightColor); UpdateLights.removeDevice(device); } UpdateLights.resetStack(); await Task.Delay(UpdateInterval); Update(); }
public static void setColorToLight(string Name, string ColorCSV) { UpdateLights.addDevice(Name, ColorCSV); }