esphome

Crates.ioesphome
lib.rsesphome
version0.1.0
sourcesrc
created_at2021-08-22 13:41:43.308953
updated_at2021-08-22 13:41:43.308953
descriptionESPHome API client for Rust.
homepage
repositoryhttps://github.com/pixelspark/esphome-rs
max_upload_size
id440702
size688,985
Tommy van der Vorst (pixelspark)

documentation

README

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:

Commit count: 15

cargo fmt