jhuery

1.0.0 • Public • Published

jHuery

A DOM HOM based library to interact with the Philips HUE lights

jHuery takes the DOM (or HOM, Home(e) Object Model :) ) API out of the browser, in the Real World (TM). It is possible to turn on all the lights this way:

jHuery('light').attr('on', true);

Or, even better, you can put the lamps in the right room, then:

var kitchenLights$ = jHuery('kitchen>light'); 
kitchenLights$.attr('on', true);
kitchenLights$.attr('color', hom.rgb2xy(255, 0, 0)); // red!

SETUP

In order to use the jHuery / HOM API, the HOM script tag must have a data-config attribute containing the bridge address and the user key:

  <script src="../dist/hom.js" data-config='{ "ip": "bridge IP address here", "key": "user key here" }'></script>
  <script src="../src/jhuery.js"></script>
 

Have fun!

LICENSE

MIT

Package Sidebar

Install

npm i jhuery

Weekly Downloads

3

Version

1.0.0

License

ISC

Last publish

Collaborators

  • gengi