static void InitializeDevices() { corsairLNP = new HidDeviceLoader().GetDevices().Where(d => d.ProductID == 0x0C0B).First(); lnpStream = corsairLNP.Open(); LightingNodeUtils.FirstTransaction(lnpStream); surface = RGBSurface.Instance; surface.Exception += args => Debug.WriteLine(args.Exception.Message); surface.UpdateMode = UpdateMode.Continuous; surface.LoadDevices(AsusDeviceProvider.Instance, RGBDeviceType.Mainboard); surface.LoadDevices(CorsairDeviceProvider.Instance); auraMb = surface.Devices.OfType <AsusMainboardRGBDevice>().First(); auraMb.UpdateMode = DeviceUpdateMode.SyncBack; corsairKeyboard = surface.Devices.OfType <CorsairKeyboardRGBDevice>().First(); corsairMousepad = surface.Devices.OfType <CorsairMousepadRGBDevice>().First(); corsairHeadsetStand = surface.Devices.OfType <CorsairHeadsetStandRGBDevice>().First(); IBridgeLocator locator = new HttpBridgeLocator(); var locateBridges = locator.LocateBridgesAsync(TimeSpan.FromSeconds(5)); IEnumerable <LocatedBridge> bridgeIPs = locateBridges.Result; if (bridgeIPs.Where(B => B.BridgeId == "001788fffe678124").Count() > 0) { bridgeOne = new LocalHueClient(bridgeIPs.Where(B => B.BridgeId == "001788fffe678124").First().IpAddress); var registerOne = bridgeOne.RegisterAsync("LightingLink", "WarMachine"); //string appKeyOne = registerOne.Result; bridgeOne.Initialize("NnmhRXVqLmBUw93kmIwi8PPCt6QHgWlHwkTYT9NC"); } if (bridgeIPs.Where(B => B.BridgeId == "001788fffea04d9c").Count() > 0) { bridgeTwo = new LocalHueClient(bridgeIPs.Where(B => B.BridgeId == "001788fffea04d9c").First().IpAddress); var registerTwo = bridgeTwo.RegisterAsync("LightingLink", "WarMachine"); //string appKeyTwo = registerTwo.Result; bridgeTwo.Initialize("2b0AIky9S2g1LgbggOgsCdNV8EzE2JS8QfBOCHHv"); } GetAsusColors(); }
static void InitializeDevices() { exclusive = new OpenConfiguration(); exclusive.SetOption(OpenOption.Exclusive, true); exclusive.SetOption(OpenOption.Interruptible, false); corsairLNP = DeviceList.Local.GetHidDevices().Where(d => d.ProductID == 0x0C0B).First(); lnpStream = corsairLNP.Open(exclusive); LightingNodeUtils.FirstTransaction(lnpStream); surface = RGBSurface.Instance; surface.Exception += args => Debug.WriteLine(args.Exception.Message); surface.LoadDevices(AsusDeviceProvider.Instance, RGBDeviceType.Mainboard); surface.LoadDevices(CorsairDeviceProvider.Instance); auraMb = surface.Devices.OfType <AsusMainboardRGBDevice>().First(); auraMb.UpdateMode = DeviceUpdateMode.SyncBack; corsairKeyboard = surface.Devices.OfType <CorsairKeyboardRGBDevice>().First(); corsairMousepad = surface.Devices.OfType <CorsairMousepadRGBDevice>().First(); corsairHeadsetStand = surface.Devices.OfType <CorsairHeadsetStandRGBDevice>().First(); GetAsusColors(); }