switchbot_api/
lib.rs

1//! This is a Rust library to interact with the [SwitchBot API]
2//! and control your SwitchBot devices programmatically.
3//!
4//! [SwitchBot API]: https://github.com/OpenWonderLabs/SwitchBotAPI
5//!
6//! # Examples
7//! ```no_run
8//! # use switchbot_api::SwitchBot;
9//! # async fn test(token: &str, secret: &str) -> anyhow::Result<()> {
10//! let mut switch_bot = SwitchBot::new_with_authentication(token, secret);
11//! switch_bot.load_devices().await?;
12//! # Ok(())
13//! # }
14//! ```
15
16mod device;
17pub use device::*;
18mod device_list;
19pub use device_list::*;
20mod switch_bot;
21pub use switch_bot::*;
22mod switch_bot_service;
23pub(crate) use switch_bot_service::*;
24pub use switch_bot_service::{CommandRequest, SwitchBotError};