Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
hue-push-client
Advanced tools
[![License](https://img.shields.io/badge/License-MIT-blue)](#license "Go to license section")
Allows easy access to the push API of Philips Hue Bridge
npm install hue-push-client
/**
* This example connects to a Hue Bridge and closes connection after 30 seconds
*/
const HuePushClient = require('hue-push-client');
const client = new HuePushClient({ip: '10.0.0.1', user: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'});
setTimeout(() => {client.close();}, 30000);
client.addEventListener('open', function () {
console.log('connection opened');
});
client.addEventListener('close', function () {
console.log('connection closed');
});
client.addEventListener('error', function (e) {
console.log('error: ' + e.message);
});
client.addEventListener('message', function (message) {
if (!message.data) {
console.log('empty message');
return;
}
try {
let data = JSON.parse(message.data);
console.log(JSON.stringify(data));
} catch (e) {
console.log('could not parse data');
return;
}
});
The data part of an incomming message looks like this:
[
{
"creationtime":"2021-09-01T08:40:54Z",
"data":[
{
"id":"d231f405-baab-406e-0000-d345a1440000",
"id_v1":"/sensors/8",
"light":{
"light_level":10509,
"light_level_valid":true
},
"type":"light_level"
}
],
"id":"f15d7da4-f849-44c9-0000-afc54dbe0000",
"type":"update"
}
]
You can also retrieve a description of all UUID's that are used in update messages:
/**
* Be aware that uuids() returns a promise
*/
async function getUUIDs() {
try {
let UUIDs = await client.uuids();
console.log(UUIDs);
} catch (e) {
console.log(e);
}
};
getUUIDs();
todo (see examples)
Released under ISC by @Pmant
FAQs
[![License](https://img.shields.io/badge/License-MIT-blue)](#license "Go to license section")
The npm package hue-push-client receives a total of 253 weekly downloads. As such, hue-push-client popularity was classified as not popular.
We found that hue-push-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.