1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! This is a Rust library to interact with the [SwitchBot API]
//! and control your SwitchBot devices programmatically.
//!
//! For a command line tool,
//! please see the [`switchbot-cli`][cli-crate] crate.
//!
//! [SwitchBot API]: https://github.com/OpenWonderLabs/SwitchBotAPI
//! [cli-crate]: https://crates.io/crates/switchbot-cli
//!
//! # Examples
//! ```no_run
//! # use switchbot_api::{CommandRequest, SwitchBot};
//! # async fn test(token: &str, secret: &str) -> anyhow::Result<()> {
//! let mut switch_bot = SwitchBot::new_with_authentication(token, secret);
//! switch_bot.load_devices().await?;
//! let device = &switch_bot.devices()[0];
//! let command = CommandRequest {
//! command: "turnOn".into(),
//! ..Default::default()
//! };
//! device.command(&command).await?;
//! # Ok(())
//! # }
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;