public void DisableStreaming() { var unused = StreamingSetup.StopStream(client, bd); LogUtil.WriteDec($"Streaming stopped: {BridgeIp}"); streaming = false; }
/// <summary> /// Set up and create a new streaming layer based on our light map /// </summary> /// <param name="ct">A cancellation token.</param> public void EnableStreaming(CancellationToken ct) { // Get our light map and filter for mapped lights Console.WriteLine($@"Hue: Connecting to bridge at {BridgeIp}..."); // Grab our stream var stream = StreamingSetup.SetupAndReturnGroup(client, bd, ct).Result; // This is what we actually need entLayer = stream.GetNewLayer(true); LogUtil.WriteInc($"Streaming established: {BridgeIp}"); streaming = true; }
public HueBridge(BridgeData data) { bd = data ?? throw new ArgumentNullException(nameof(data)); BridgeIp = bd.Ip; BridgeKey = bd.Key; BridgeUser = bd.User; client = StreamingSetup.GetClient(bd); disposed = false; streaming = false; entLayer = null; Console.WriteLine(@"Hue: Loading bridge: " + BridgeIp); }