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

campusbadge-nodered

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

campusbadge-nodered - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

README.md

71

badge.js

@@ -7,6 +7,4 @@ const mustache = require("mustache");

var node = this;
this.badgeid = config.badgeid;
this.lights = config.lights;
this.tone = config.tone;
this.time = config.time;
this.tone = config.tone;
this.time = config.time;
this.led1 = config.led1;

@@ -17,43 +15,40 @@ this.led2 = config.led2;

this.led5 = config.led5;
this.lights = config.lights;
this.text = config.text;
node.on('input', function(msg) {
var data = dataobject(this.context(), msg)
msg.payload = {}
if (config.text != ''){
msg.payload.text = mustache.render(config.text, data)
}
if (this.time != ''){
msg.payload.sound = {}
msg.payload.sound.tone = this.tone;
msg.payload.sound.time = this.time;
}
if (this.lights != null){
msg.payload.lights = []
var data = dataobject(this.context(), msg)
this.badgeid = mustache.render(config.badgeid, data)
this.text = mustache.render(config.text, data)
this.time = mustache.render(config.time, data)
this.tone = mustache.render(config.tone, data)
msg.payload = {}
if (this.text != ''){
msg.payload.t = this.text
}
if (this.time != ''){
msg.payload.f = this.tone;
msg.payload.d = this.time;
}
msg.payload.l = []
var d = hexToRgb(this.led1)
msg.payload.lights.push(d.g)
msg.payload.lights.push(d.r)
msg.payload.lights.push(d.b)
msg.payload.l.push(d.g)
msg.payload.l.push(d.r)
msg.payload.l.push(d.b)
d = hexToRgb(this.led2)
msg.payload.lights.push(d.g)
msg.payload.lights.push(d.r)
msg.payload.lights.push(d.b)
msg.payload.l.push(d.g)
msg.payload.l.push(d.r)
msg.payload.l.push(d.b)
d = hexToRgb(this.led3)
msg.payload.lights.push(d.g)
msg.payload.lights.push(d.r)
msg.payload.lights.push(d.b)
msg.payload.l.push(d.g)
msg.payload.l.push(d.r)
msg.payload.l.push(d.b)
d = hexToRgb(this.led4)
msg.payload.lights.push(d.g)
msg.payload.lights.push(d.r)
msg.payload.lights.push(d.b)
msg.payload.l.push(d.g)
msg.payload.l.push(d.r)
msg.payload.l.push(d.b)
d = hexToRgb(this.led5)
msg.payload.lights.push(d.g)
msg.payload.lights.push(d.r)
msg.payload.lights.push(d.b)
}
console.log(msg.payload)
clean(msg.payload)
console.log(msg.payload)
msg.topic = "/badge/"+this.badgeid+"/message"
node.send(msg);
msg.payload.l.push(d.g)
msg.payload.l.push(d.r)
msg.payload.l.push(d.b)
msg.topic = "/badge/"+this.badgeid+"/message"
node.send(msg);
});

@@ -60,0 +55,0 @@ }

{
"name": "campusbadge-nodered",
"version": "0.0.1",
"version": "0.0.2",
"description": "NodeRED package for the Campus Badge",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

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