Expand description
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
crate.
§Examples
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?;
Structs§
- Command
Help - Human-readable description of a
CommandRequest
. - Command
Request - A command request to send to the SwitchBot API.
- Device
- A device in the SwitchBot API.
- Device
List - A list of
Device
s. - Help
- Load and parse the documentations at the SwitchBot API.
- Markdown
- Represents a simple Markdown.
- Switch
Bot - Represents a SwitchBot API server.
- Switch
BotError - Error from the SwitchBot API.