mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Misc tidy ups of jsHint "issues" for some node-red-nodes
This commit is contained in:
parent
3644f16a89
commit
f4fdebfba5
@ -14,7 +14,8 @@
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
var RED = require(process.env.NODE_RED_HOME + "/red/red");
|
||||
module.exports = function(RED) {
|
||||
"use strict";
|
||||
|
||||
function SmoothNode(n) {
|
||||
RED.nodes.createNode(this, n);
|
||||
@ -57,3 +58,4 @@ function SmoothNode(n) {
|
||||
});
|
||||
}
|
||||
RED.nodes.registerType("smooth", SmoothNode);
|
||||
}
|
||||
|
@ -41,9 +41,6 @@ module.exports = function(RED) {
|
||||
// GPIO pins 11 (R), 13 (G), 15 (B).
|
||||
|
||||
function LedBorgNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
var node = this;
|
||||
|
||||
RED.nodes.createNode(this,n);
|
||||
this.pin = n.pin;
|
||||
this.set = n.set || false;
|
||||
@ -69,10 +66,10 @@ module.exports = function(RED) {
|
||||
}
|
||||
else if (p3.test(msg.payload)) {
|
||||
var c = msg.payload.split(",");
|
||||
var r = Math.floor(parseInt(c[0])*100/256).toString();
|
||||
var g = Math.floor(parseInt(c[1])*100/256).toString();
|
||||
var b = Math.floor(parseInt(c[2])*100/256).toString();
|
||||
rgb = r+","+g+","+b;
|
||||
var r1 = Math.floor(parseInt(c[0])*100/256).toString();
|
||||
var g1 = Math.floor(parseInt(c[1])*100/256).toString();
|
||||
var b1 = Math.floor(parseInt(c[2])*100/256).toString();
|
||||
rgb = r1+","+g1+","+b1;
|
||||
}
|
||||
else {
|
||||
// you can add fancy colours by name here if you want...
|
||||
|
@ -23,9 +23,9 @@ module.exports = function(RED) {
|
||||
var pre = "\\\\.\\";
|
||||
|
||||
if (!plat.match(/^win/)) {
|
||||
pre = "";
|
||||
throw "Info : only needed for Windows boxes without serialport npm module installed.";
|
||||
//util.log("[26-rawserial.js] Info : only really needed for Windows boxes without serialport npm module installed.");
|
||||
pre = "";
|
||||
}
|
||||
|
||||
function RawSerialInNode(n) {
|
||||
|
@ -35,10 +35,10 @@ module.exports = function(RED) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
var l = JSON.stringify(msg.payload).length;
|
||||
var le = JSON.stringify(msg.payload).length;
|
||||
msg.payload = msgpack.encode(msg.payload);
|
||||
node.send(msg);
|
||||
node.status({text:l +" o->b "+ msg.payload.length});
|
||||
node.status({text:le +" o->b "+ msg.payload.length});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ var exifNode = require("../../../utility/exif/94-exif.js");
|
||||
var helper = require('../../../../node-red/test/nodes/helper.js');
|
||||
|
||||
describe('exif node', function() {
|
||||
"use strict";
|
||||
|
||||
beforeEach(function(done) {
|
||||
helper.startServer(done);
|
||||
|
@ -15,6 +15,7 @@
|
||||
**/
|
||||
|
||||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
@ -51,7 +52,5 @@ module.exports = function(grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-lint-inline');
|
||||
|
||||
grunt.registerTask('default',
|
||||
['jshint:all', 'simplemocha:all']);
|
||||
|
||||
grunt.registerTask('default', ['jshint:all', 'simplemocha:all']);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user