public static async Task<Bridge> FindAsync()
{
using (var client = new HttpClient())
{
try
{
string response = await client.GetStringAsync(new Uri("https://www.meethue.com/api/nupnp"));
if (response == "[]")
{
return null;
}
string ip = JArray.Parse(response).First["internalipaddress"].ToString();
return new Bridge(ip);
}
catch (Exception)
{
return null;
}
}
}