| Crates.io | esphome |
| lib.rs | esphome |
| version | 0.1.0 |
| created_at | 2021-08-22 13:41:43.308953+00 |
| updated_at | 2021-08-22 13:41:43.308953+00 |
| description | ESPHome API client for Rust. |
| homepage | |
| repository | https://github.com/pixelspark/esphome-rs |
| max_upload_size | |
| id | 440702 |
| size | 688,985 |
ESPHome API client for Rust.
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)?;
// ...
}
cargo run --example connect -- -a some.device:6053 -p some_password
MIT except for the following: