Beispiel #1
0
        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());
            }
        }
Beispiel #2
0
        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());
            }
        }