How to use the node-hue-api.v3 function in node-hue-api

To help you get started, we’ve selected a few node-hue-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecaron / smart-nightlight-manager / utils / brightChecker.js View on Github external
/* eslint new-cap: ["error", { "newIsCap": false }] */
const hue = require('node-hue-api').v3

const hex2rgb = require('../lib/hex2rgb')
const db = require('../lib/db')

if (process.argv.length !== 3) {
  console.warn('This script must be run as `node brightChecker.js ID`, where ID is the number Hue has for light')
  process.exit(1)
}

db.event.on('loaded', function () {
  const bridgeInfo = db.settings.findOne({ type: 'hue' })

  if (!bridgeInfo) {
    console.warn('Did you forget to run Hue settings setup?')
    process.exit(1)
  }
github GladysAssistant / Gladys / server / services / philips-hue / index.js View on Github external
module.exports = function PhilipsHueService(gladys, serviceId) {
  // require the node-hue-api module
  // @ts-ignore
  const hueClient = require('node-hue-api').v3;
  const philipsHueLightHandler = new PhilipsHueLightHandler(gladys, hueClient, serviceId);

  /**
   * @public
   * @description This function starts the PhilipsHueService service
   * @example
   * gladys.services['philips-hue'].start();
   */
  async function start() {
    logger.log('starting Philips Hue service');
    philipsHueLightHandler.init();
  }

  /**
   * @public
   * @description This function stops the PhilipsHueService service