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
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
20 changed files with 154 additions and 184 deletions

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

@ -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),
var msg = {
'topic': node.topic + '/temperature',
'payload': {
'object': +objectTemperature.toFixed(1),
'ambient': +ambientTemperature.toFixed(1)
};
}
}
node.send(msg);
});
sensorTag.enableBarometricPressure(function() {});
@ -59,7 +62,8 @@ 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),
msg.payload = {
'temperature': +temp.toFixed(1),
'humidity': +humidity.toFixed(1)
};
if ((temp !== -40) || (humidity !== 100)) {

View File

@ -320,6 +320,7 @@ module.exports = function(RED) {
obj.serial.on('error', function(err) {
RED.log.error(RED._("serial.errors.error",{port:port,error:err.toString()}));
obj._emitter.emit('closed');
if (obj.tout) { clearTimeout(obj.tout); }
obj.tout = setTimeout(function() {
setupSerial();
}, settings.serialReconnectTime);
@ -328,6 +329,7 @@ module.exports = function(RED) {
if (!obj._closing) {
RED.log.error(RED._("serial.errors.unexpected-close",{port:port}));
obj._emitter.emit('closed');
if (obj.tout) { clearTimeout(obj.tout); }
obj.tout = setTimeout(function() {
setupSerial();
}, settings.serialReconnectTime);

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-serialport",
"version" : "0.8.3",
"version" : "0.8.4",
"description" : "Node-RED nodes to talk to serial ports",
"dependencies" : {
"serialport" : "^7.1.5"

View File

@ -67,7 +67,6 @@ module.exports = function(RED) {
node.log('subscribing to: '+node.topic);
node.client.subscribe(node.topic, function(body, headers) {
var newmsg={"headers":headers,"topic":node.topic}
try {
newmsg.payload = JSON.parse(body);
}

View File

@ -4,11 +4,16 @@
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// * Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// Neither the name of Smaz nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Our compression codebook
var rc = [
@ -63,9 +68,7 @@ var smaz = module.exports = {
}
// Emit the byte
output.push(code);
input_index += j;
encoded = true;
break;
}
@ -74,7 +77,6 @@ var smaz = module.exports = {
// Match not found - add the byte to the verbatim buffer
verbatim += input[input_index];
input_index++;
// Flush if we reached the verbatim bytes length limit
if (verbatim.length == 256) {
output = output.concat(smaz.flush_verbatim(verbatim));