[−][src]Module tplinker::discovery
Discover devices on the local network
use tplinker::{ discovery::discover, devices::Device, capabilities::Switch, }; for (addr, data) in discover().unwrap() { let device = Device::from_data(addr, &data); let sysinfo = data.sysinfo(); println!("{}\t{}\t{}", addr, sysinfo.alias, sysinfo.hw_type); match device { Device::HS110(device) => { device.switch_on().unwrap(); }, _ => {}, } }
Functions
discover | Discover TPLink smart devices on the local network |
with_timeout | Discover TPLink smart devices on the local network |