GithubHelp home page GithubHelp logo

rektdeckard / hues Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 296 KB

A Rust client for the Philips Hue API v2

License: MIT License

Rust 100.00%
home-assistant home-automation iot lightning philips-hue rust

hues's People

Contributors

rektdeckard avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

paluche

hues's Issues

BadDeserialize error

I am running this example code with version 0.1.0:

use std::fs;
use hues::prelude::*;

#[tokio::main]
async fn main() -> Result<(), HueAPIError> {
    // Construct a Bridge when IP and App Key are known
    let key = fs::read_to_string("hue_key").expect("Missing key file");
    let bridge = Bridge::new([10, 0, 10, 3], key);
    // Refresh it to fetch the current state of all resources
    bridge.refresh().await?;

    // Toggle the power state of a Room named "office", if it exists
    if let Some(office) = bridge.rooms().iter().find(|r| r.name() == "office") {
        office.toggle().await?;
    }
    Ok(())
}

and I am getting this error:

Err E reqwest::Error { kind: Decode, source: Error("unknown variant `living_room`, expected one of `attic`, `balcony`, `barbecue`, `bathroom`, `bedroom`, `carport`, `closet`, `computer`, `dining`, `downstairs`, `driveway`, `front_door`, `garage`, `garden`, `guest_zone`, `gym`, `hallway`, `home`, `kids_bedroom`, `kitchen`, `laundry_zone`, `living_zone`, `lounge`, `man_cave`, `music`, `nursery`, `office`, `other`, `pool`, `porch`, `reading`, `recreation`, `staircase`, `storage`, `studio`, `terrace`, `toilet`, `top_floor`, `tv`, `upstairs`", line: 1, column: 11345) }
error decoding response body: unknown variant `living_room`, expected one of `attic`, `balcony`, `barbecue`, `bathroom`, `bedroom`, `carport`, `closet`, `computer`, `dining`, `downstairs`, `driveway`, `front_door`, `garage`, `garden`, `guest_zone`, `gym`, `hallway`, `home`, `kids_bedroom`, `kitchen`, `laundry_zone`, `living_zone`, `lounge`, `man_cave`, `music`, `nursery`, `office`, `other`, `pool`, `porch`, `reading`, `recreation`, `staircase`, `storage`, `studio`, `terrace`, `toilet`, `top_floor`, `tv`, `upstairs` at line 1 column 11345
Error: BadDeserialize

can you advice if my setup or version of Hue bridge is incompatible or how to fix? Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.