Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hue-daylight

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hue-daylight

Auto change hue lights to match daylight based on the sun schedule

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Hue Daylight

Auto change hue lights to match daylight based on the sun schedule

Usage

	const hueDaylight = require('hue-daylight');
	const daylight = hueDaylight(config); // See example config beloy
	daylight.start();

	// Later

	daylight.stop();

Example Config

// config.js
module.exports = {
//	 fake: {
//		initial: 
//		skip: 
//	},
	colors: {
		'<name>': [x, y] // Color xy format

		RED : [ 0.6807, 0.3032],
		ORNG: [ 0.6041, 0.3743],
		GOLD: [ 0.4566, 0.4108],
		PINK: [ 0.3203, 0.3172],
		BLUE: [ 0.3003, 0.3102]
	}
	bridge: {
		username: '' // Hue Bridge Username
		ipaddress: '192.168.1.117' // IP of Hue Bridge
	}
	location: {
		// Used to calc sunrise / sunset
		lat: 30.2198,
		lon: -98.3586,
	},
	interval: 5,
	configurations: [
		{
			name: /^recessed|light/i, // regex to match 
			breakpoints: [
			    {offset: -1.00, color: 'GOLD'},
			    {offset: -0.30, color: 'RED'},
				{offset:  0.00, color: 'ORNG'},
				{offset:  0.05, color: 'GOLD'},
				{offset:  0.15, color: 'PINK'},
				{offset:  0.50, color: 'PINK'},
				{offset:  0.60, color: 'BLUE'},
				{offset:  0.70, color: 'PINK'},
				{offset:  0.95, color: 'GOLD'},
				{offset:  2.00, color: 'GOLD'}
			]
		}
	]
};

Offset

Offset is scaled based on sunrise and sunset. We use 3 ranges:

WhenRange
0:00 to sunrise-1 to 0
sunrise to sunset0 to 1
sunset to 23:591 to 2

FAQs

Package last updated on 16 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc