use rustuya::sync::Scanner;
fn main() {
println!("--- Rustuya Device Scanner Example ---");
println!("[INFO] Scanning the network for Tuya devices in real-time...");
let stream = Scanner::scan_stream();
let mut count = 0;
for device in stream {
count += 1;
println!(
"[{}] Found Device: ID={}, IP={}, Version={:?}",
count, device.id, device.ip, device.version
);
}
println!("[INFO] Scan finished. Total devices found: {count}");
}