switchbot_api2/
lib.rs

1//! # 🤖 Switchbot
2//!
3//! Rust client for controlling [SwitchBot](https://www.switch-bot.com/) devices.
4//!
5//! ## Basic Usage
6//!
7//! ```rust
8//! let switchbot = switchbot_api2::SwitchBot::new_from_env()?;
9//! for d in switchbot.get_devices().await? {
10//!     println!("{}: {:?}", d.name, switchbot.get_status(&d).await?);
11//! }
12//! ```
13
14mod api;
15mod device;
16mod devices;
17mod switchbot;
18
19pub use api::*;
20pub use device::*;
21pub use devices::*;
22pub use switchbot::*;
23
24pub use ::anyhow::{Error, Result};