[−][src]Function huelib::bridge::discover_nupnp
pub fn discover_nupnp() -> Result<Vec<IpAddr>>
Discovers bridges in the local netowork using N-UPnP.
This sends a HTTP GET request to https://discovery.meethue.com, to get IP addresses of bridges that are in the local network.
Examples
Get the IP addresses of all discovered bridges:
let ip_addresses = huelib::bridge::discover_nupnp()?;
Register a user on the bridge that was first discovered:
use huelib::bridge; let ip = bridge::discover_nupnp()?.pop().expect("found no bridges"); let username = bridge::register_user(ip, "example")?; println!("Registered user: {}", username);