rektdeckard / hues Goto Github PK
View Code? Open in Web Editor NEWA Rust client for the Philips Hue API v2
License: MIT License
A Rust client for the Philips Hue API v2
License: MIT License
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.