1 unstable release
0.1.0 | Aug 22, 2021 |
---|
#231 in #connection
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:
- src/api.proto and src/api_options.proto: copied from the aioesphomeapi repository under the MIT license.
Dependencies
~2.5MB
~49K SLoC