ESPHome API client for Rust.
````rust use esphome::Connection; use std::net::TcpStream;
let mut stream = TcpStream::connect(opt.address)?; let mut writestream = stream.tryclone()?; let connection = Connection::new(&mut stream, &mut writestream); let device = connection.connect()?; println!("Connected to {}", device.serverinfo());
if let Some(password) = opt.password { let ad = device.authenticate(&password)?; // ... } ````
sh
cargo run --example connect -- -a some.device:6053 -p some_password
MIT except for the following: