No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-17 21:31:50 +02:00
examples init 2026-04-17 21:31:50 +02:00
src init 2026-04-17 21:31:50 +02:00
.gitignore init 2026-04-17 21:31:50 +02:00
Cargo.lock init 2026-04-17 21:31:50 +02:00
Cargo.toml init 2026-04-17 21:31:50 +02:00
LICENSE init 2026-04-17 21:31:50 +02:00
README.md init 2026-04-17 21:31:50 +02:00

govee-rs

An async Rust client for the Govee OpenAPI.

Control Govee smart lights from Rust: turn them on or off, change colors, and set brightness — all over the official cloud API.

[dependencies]
govee-rs = "0.1"
tokio = { version = "1", features = ["full"] }

Usage

use govee_rs::GoveeApiBuilder;

#[tokio::main]
async fn main() -> Result<(), govee_rs::GoveeError> {
    let mut api = GoveeApiBuilder::new()
        .api_key(std::env::var("GOVEE_API_KEY").unwrap())
        .build()
        .await?;

    let devices = api.get_devices().await?;

    if let Some(d) = devices.first() {
        api.turn_on(d).await?;
        api.set_color(d, 255, 140, 0).await?;   // warm orange
        api.set_brightness(d, 75).await?;
    }

    Ok(())
}

Getting an API key

Open the Govee Home app → Profile → About Us → Apply for API key. You'll receive a key by email within a few minutes.

Running the example

GOVEE_API_KEY=your_key cargo run --example basic

Error handling

All fallible functions return Result<T, GoveeError>. The variants are:

Variant When
MissingApiKey .build() called without .api_key()
EmptyApiKey API key was blank/whitespace
Http Network-level failure (timeout, TLS, etc.)
ApiError { status, body } Govee returned a non-2xx status
Json Response body failed to parse

License

MIT