blargoner / jshue Goto Github PK
View Code? Open in Web Editor NEWjavascript library for philips hue
License: MIT License
javascript library for philips hue
License: MIT License
Thanks for this project, here's a (probably super-simple) question from a Javascript newbie ;-) I've got user.setLightState to work without issues so I can turn the lamp on or off, but how do I use getLight or getLights to check the status of the light? It just returns true (for sending the request) and not the actual status...
Please have an npm wrapper for use with webpack/browserify. Npm packages are then managed for updates and devs can use the npm cdns out there. ๐
Small question - does jshue have any browser-based dependencies, such as using window for storing values, or other behavior that only work in browsers?
Am asking, as I use QML (Qt Quick), which uses Javascript without browser-related components.
Regards,
Nc.
Would be great to have the typings for typescript :)
Bonus:
Having classes for Light, Sensor, etc.
The URL needs to be changed from 'http' to 'https'.
I managed to control lamps and schedules via java script.
e.g. user.setSchedule(sched, { status: "disabled" }, function(data) { /* ... */ });
But how can I get information from the bridge?
Tried this, but it didn't work: user.getSchedule(sched, function(data) { st = data[0].status; });
Thank you very much!
Peter
Create group
Delete group
It would be nice to specify a time at which to give up searching for or making a request to a local bridge.
In the future, the Hue API will no longer support creating users with custom usernames on the bridge, only users with bridge-generated usernames. A new bridge method will need to be added to jsHue to support this change.
It will look something like:
var bridge = jsHue().bridge('192.168.1.2');
bridge.createUser('foo application', function(data) {
// extract bridge-generated username from returned data
var user = bridge.user(data[0].success.username);
});
I am not sure what I am doing incorrectly, but I only get errors when creating a user.
var user = hue.bridge('10.0.0.162').user('bakman');
// create user account (requires link button to be pressed)
user.create('bakman huetest',
function(success){
console.log(success)
},
function(error){
console.log(error)
}
);
[{"error":{"type":7,"address":"/username","description":"invalid value, bakman, for parameter, username"}}]
Hi,
I managed to get authenticated and switch the lights on/off (inside the bridge.createUser function).
How do I store the "user info" to use it again later (without authentication on every page reload)?
tried:
var user = 'AME8QQ.......';
user.setLightState(1, { on: false }, function(data) { /* ... */ });
error = user.setLightState is not a function
Old endpoint: https://www.meethue.com/api/nupnp
New endpoint: https://discovery.meethue.com
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.