private async void SsdpLocateBridgeAction() { var result = await SsdpLocateBridgeDataLoader.LoadAsync(() => ssdpLocator.LocateBridgesAsync(TimeSpan.FromSeconds(5))); SsdpBridges = string.Join(", ", result.ToArray()); if (result.Count() > 0) { _hueClient = new HueClient(result.First()); } }
private async void SsdpLocateBridgeAction() { var result = await SsdpLocateBridgeDataLoader.LoadAsync(() => ssdpLocator.LocateBridgesAsync(TimeSpan.FromSeconds(5))); if (result == null) { result = new List <LocatedBridge>(); } SsdpBridges = string.Join(", ", result.Select(x => x.IpAddress).ToArray()); if (result.Count() > 0) { _hueClient = new LocalHueClient(result.Select(x => x.IpAddress).First()); } }