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//! For a command line tool,
5//! please see the [`switchbot-cli`][cli-crate] crate.
6//!
7//! [SwitchBot API]: https://github.com/OpenWonderLabs/SwitchBotAPI
8//! [cli-crate]: https://crates.io/crates/switchbot-cli
9//!
10//! # Examples
11//! ```no_run
12//! # use switchbot_api::SwitchBot;
13//! # async fn test(token: &str, secret: &str) -> anyhow::Result<()> {
14//! let mut switch_bot = SwitchBot::new_with_authentication(token, secret);
15//! switch_bot.load_devices().await?;
16//! # Ok(())
17//! # }
18//! ```
19
20mod device;
21pub use device::*;
22mod device_list;
23pub use device_list::*;
24mod switch_bot;
25pub use switch_bot::*;
26mod switch_bot_service;
27pub use switch_bot_service::*;