コード例 #1
0
 //const string 
 public static async Task<IEnumerable<HueBridgeDescription>> FindHueBridges()
 {
     IBridgeLocator locator = new Q42.HueApi.WinRT.SSDPBridgeLocator();
     IEnumerable<string> bridgeIPs = await locator.LocateBridgesAsync(TimeSpan.FromSeconds(10));
     List<HueBridgeDescription> clients = new List<HueBridgeDescription>();
     foreach (var ip in bridgeIPs)
     {
         XmlDocument descriptionDoc = await XmlDocument.LoadFromUriAsync(new Uri($"http://{ip}/description.xml"));
         clients.Add(new HueBridgeDescription(descriptionDoc, ip));
     }
     return clients;
 }