1 unstable release

0.1.0 Aug 22, 2021

#168 in #connection

MIT license

655KB
15K SLoC

ESPHome.rs

ESPHome API client for Rust.

Usage

use esphome::Connection;
use std::net::TcpStream;

let mut stream = TcpStream::connect(opt.address)?;
	let mut write_stream = stream.try_clone()?;
let connection = Connection::new(&mut stream, &mut write_stream);
let device = connection.connect()?;
println!("Connected to {}", device.server_info());

if let Some(password) = opt.password {
	let ad = device.authenticate(&password)?;
	// ...
}

Running an example

cargo run --example connect -- -a some.device:6053 -p some_password

License

MIT except for the following:

Dependencies

~2.5MB
~49K SLoC