A whole bunch of whitespace linting - no functional changes

This commit is contained in:
Dave Conway-Jones
2019-08-11 13:37:15 +01:00
parent 8e2352b08a
commit e20cf97fce
20 changed files with 154 additions and 184 deletions

View File

@@ -179,8 +179,8 @@ module.exports = function(RED) {
node.board.sysexCommand(msg.payload);
}
if (node.state === "STRING") {
node.board.sendString(msg.payload.toString());
}
node.board.sendString(msg.payload.toString());
}
}
});
node.board.once('disconnect', function() {

View File

@@ -92,7 +92,7 @@ module.exports = function(RED) {
var val;
if (node.intype == "up") { val = 1; }
if (node.intype == "down") { val = 0; }
setTimeout(function(){
setTimeout(function() {
node.send({ topic:"pi/"+node.pin, payload:val });
node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:val})});
},250);
@@ -194,7 +194,7 @@ module.exports = function(RED) {
}
else {
node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"});
node.on("input", function(msg){
node.on("input", function(msg) {
node.status({fill:"grey",shape:"dot",text:RED._("rpi-gpio.status.na",{value:msg.payload.toString()})});
});
}
@@ -303,14 +303,14 @@ module.exports = function(RED) {
});
node.on("close", function(done) {
node.status({});
if (node.child != null) {
node.finished = done;
node.child.kill('SIGINT');
node.child = null;
}
else { done(); }
});
node.status({});
if (node.child != null) {
node.finished = done;
node.child.kill('SIGINT');
node.child = null;
}
else { done(); }
});
}
else {
node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"});

View File

@@ -90,7 +90,7 @@ module.exports = function(RED) {
}
else {
node.status({fill:"grey",shape:"dot",text:"node-red:rpi-gpio.status.not-available"});
node.on("input", function(msg){
node.on("input", function(msg) {
node.status({fill:"grey",shape:"dot",text:RED._("node-red:rpi-gpio.status.na",{value:msg.payload.toString()})});
});
}

View File

@@ -145,43 +145,6 @@ module.exports = function(RED) {
break;
}
//case "holiday" : {
//if (DEBUG) {
//hminnode.log("Hit the holiday case");
//}
//if (!('enabled' in message.payload[key]) && !('time' in message.payload[key])) {
//hminnode.log("Warning: Unsupported 'holiday' value passed!");
//eturn;
//}
//var time = message.payload[key].time;
//// Ensure hminnode time is a date
//if (typeof(time) == "string") {
//hminnode.log("Typeof time was " +typeof(message.payload[key].time));
//// message.payload[key].time = new Date(message.payload[key].time);
//message.payload[key].time = new Date(2014, 02, 15, 12, 0, 0);
//hminnode.log("Typeof time is now " +typeof(message.payload[key].time));
//}
//// Also add in away mode (for hot water) if we're on hols
//if (message.payload[key].time) {
//message.payload.away_mode = 1;
//}
//else {
//message.payload.away_mode = 0;
//}
//break;
// }
//case "hotwater" : {
//if (DEBUG) {
//hminnode.log("Hit the hotwater case");
//}
//if (message.payload[key] !== "on" && message.payload[key] !== "boost" && message.payload[key] !== "off") {
//hminnode.log("Warning: Unsupported 'hotwater' value passed!");
//return;
//}
//break;
// }
case "heating" : {
// Ensure heating stays last! It's got a multi write scenario
if (DEBUG) {

View File

@@ -1,5 +1,5 @@
module.exports = function(RED) {
module.exports = function(RED) {
"use strict";
//import noble

View File

@@ -44,10 +44,13 @@ module.exports = function(RED) {
sensorTag.enableIrTemperature(function() {});
sensorTag.on('irTemperatureChange',
function(objectTemperature, ambientTemperature) {
var msg = {'topic': node.topic + '/temperature'};
msg.payload = {'object': +objectTemperature.toFixed(1),
'ambient': +ambientTemperature.toFixed(1)
};
var msg = {
'topic': node.topic + '/temperature',
'payload': {
'object': +objectTemperature.toFixed(1),
'ambient': +ambientTemperature.toFixed(1)
}
}
node.send(msg);
});
sensorTag.enableBarometricPressure(function() {});
@@ -59,8 +62,9 @@ module.exports = function(RED) {
sensorTag.enableHumidity(function() {});
sensorTag.on('humidityChange', function(temp, humidity) {
var msg = {'topic': node.topic + '/humidity'};
msg.payload = {'temperature': +temp.toFixed(1),
'humidity': +humidity.toFixed(1)
msg.payload = {
'temperature': +temp.toFixed(1),
'humidity': +humidity.toFixed(1)
};
if ((temp !== -40) || (humidity !== 100)) {
node.send(msg);