#smart-home #server #client #go #rewrite

smarthome-sdk-rs

A Rust client-library which makes communication with the Smarthome server easy

17 releases (breaking)

0.13.0 Oct 22, 2024
0.12.1 Sep 4, 2023
0.12.0 Aug 9, 2023
0.11.0 Jun 16, 2023
0.8.0 Oct 30, 2022

#1571 in Network programming

Download history 1/week @ 2025-02-05 1/week @ 2025-02-12

1,018 downloads per month

GPL-2.0-only

45KB
1K SLoC

Smarthome SDK (Rust rewrite)

This is the new and improved version of the old SDK.

A Rust create which makes communication to a Smarthome server simple. It can be seen as a API wrapper for some commonly-used functions of the Smarthome server's API.

Usage

cargo add smarthome-sdk-rs
use smarthome_sdk_rs::{Auth, Client};

#[tokio::main]
async fn main() {
    // Create a new Smarthome client
    let client = Client::new(
        "http://localhost:8082",
        Auth::QueryToken("b67f2f5c7f2e6795d9f9b55678db7579".to_string()),
    )
    .await
    .unwrap();

    // Do something with the client
    // This will turn on the finctional desk lamp
    client.set_power("desk_lamp", true).await.unwrap();
}

Dependencies

~4–20MB
~227K SLoC