Skip to main content

Crate govee_api2

Crate govee_api2 

Source
Expand description

§govee-api2

A Rust client for Govee’s v2 router-based platform API (https://openapi.api.govee.com).

Supported:

  • Device and group discovery
  • Device state queries
  • Device control (power, brightness, color, color temperature)
  • Dynamic light scenes and DIY scenes (list + activate)
  • Per-segment color and brightness for segmented lights
  • Configurable timeout and retry with backoff, typed rate-limit errors

§Example

use govee_api2::GoveeClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = GoveeClient::new("your-api-key");

    // List all devices
    let devices = client.get_devices().await?;
    println!("Found {} devices", devices.len());

    // Control a device
    if let Some(device) = devices.first() {
        client.turn_on(&device.device, &device.sku).await?;
        client.set_brightness(&device.device, &device.sku, 80).await?;
    }

    Ok(())
}

Re-exports§

pub use client::ClientConfig;
pub use client::GoveeClient;
pub use error::Error;
pub use error::Result;
pub use types::*;

Modules§

client
error
types