diff --git a/.travis.yml b/.travis.yml index d30ad360..1ad40c11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,12 @@ sudo: false language: node_js matrix: - allow_failures: - - node_js: 16 + # allow_failures: + # - node_js: 16 include: - node_js: 16 - node_js: 14 - node_js: 12 - - node_js: 10 # - python: 2.7 # language: python # before_script: pip install flake8 diff --git a/function/datagenerator/package.json b/function/datagenerator/package.json index be3b1276..1e0777b8 100644 --- a/function/datagenerator/package.json +++ b/function/datagenerator/package.json @@ -1,9 +1,9 @@ { "name" : "node-red-node-data-generator", - "version" : "0.2.0", + "version" : "1.0.0", "description" : "A Node-RED node to create a string of dummy data values from a template. Useful for test-cases.", "dependencies" : { - "dummy-json": "^2.0.0" + "dummy-json": "^3.0.4" }, "repository" : { "type":"git", diff --git a/hardware/PiGpio/nrgpio.py b/hardware/PiGpio/nrgpio.py index 4b5b9875..4bfb605f 100755 --- a/hardware/PiGpio/nrgpio.py +++ b/hardware/PiGpio/nrgpio.py @@ -171,24 +171,19 @@ if len(sys.argv) > 2: data = 0 elif cmd == "mouse": # catch mice button events - file = open( "/dev/input/mice", "rb" ) + f = open( "/dev/input/mice", "rb" ) oldbutt = 0 - def getMouseEvent(): - global oldbutt - global pin - buf = file.read(3) - pin = pin & 0x07 - button = ord( buf[0] ) & pin # mask out just the required button(s) - if button != oldbutt: # only send if changed - oldbutt = button - print(button) - while True: try: - getMouseEvent() + buf = f.read(3) + pin = pin & 0x07 + button = struct.unpack('3b',buf)[0] & pin # mask out just the required button(s) + if button != oldbutt: # only send if changed + oldbutt = button + print(button) except: - file.close() + f.close() sys.exit(0) elif cmd == "kbd": # catch keyboard button events @@ -196,7 +191,7 @@ if len(sys.argv) > 2: while not os.path.isdir("/dev/input/by-path"): sleep(10) infile = subprocess.check_output("ls /dev/input/by-path/ | grep -m 1 'kbd'", shell=True).strip() - infile_path = "/dev/input/by-path/" + infile + infile_path = "/dev/input/by-path/" + infile.decode("utf-8") EVENT_SIZE = struct.calcsize('llHHI') file = open(infile_path, "rb") event = file.read(EVENT_SIZE) diff --git a/hardware/PiGpio/package.json b/hardware/PiGpio/package.json index 018302b4..787f300b 100644 --- a/hardware/PiGpio/package.json +++ b/hardware/PiGpio/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-pi-gpio", - "version": "2.0.0-beta4", + "version": "2.0.1", "description": "The basic Node-RED node for Pi GPIO", "dependencies" : { }, diff --git a/hardware/mcp3008/package.json b/hardware/mcp3008/package.json index ed6df3b6..2efdca9e 100644 --- a/hardware/mcp3008/package.json +++ b/hardware/mcp3008/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-pi-mcp3008", - "version" : "0.5.0", + "version" : "0.5.1", "description" : "A Node-RED node to read from the MCP3008 Analogue to Digital Converter", "dependencies" : { "mcp-spi-adc": "^3.2.0" diff --git a/hardware/mcp3008/pimcp3008.js b/hardware/mcp3008/pimcp3008.js index ebb0066a..b39c63f1 100644 --- a/hardware/mcp3008/pimcp3008.js +++ b/hardware/mcp3008/pimcp3008.js @@ -29,7 +29,6 @@ module.exports = function(RED) { this.bus = parseInt(n.bus || 0); this.dev = n.dev || "3008"; this.mcp3xxx = []; - var node = this; this.cb = function (err) { if (err) { node.error("Error: "+err); } }; this.opt = { speedHz:20000, deviceNumber:node.dnum, busNumber:node.bus }; var chans = parseInt(this.dev.substr(3)); @@ -40,14 +39,14 @@ module.exports = function(RED) { fs.statSync("/dev/spidev"+node.bus+"."+node.dnum); if (node.mcp3xxx.length === 0) { for (var i=0; i=0.18.0", + "version": ">=1.0.0", "nodes": { "serialport": "25-serial.js" } }, - "engines" : { "node" : ">=8.6.0" }, + "engines" : { "node" : ">=10.0.0" }, "author": { "name": "Dave Conway-Jones", "email": "ceejay@vnet.ibm.com", diff --git a/package.json b/package.json index 7f9a1c0b..6eae23d6 100644 --- a/package.json +++ b/package.json @@ -48,14 +48,14 @@ "ngeohash": "^0.6.3", "node-red": "^2.1.3", "node-red-node-test-helper": "^0.2.7", - "nodemailer": "^6.7.0", + "nodemailer": "^6.7.1", "poplib": "^0.1.7", "proxyquire": "^2.1.3", "pushbullet": "^2.4.0", "sentiment": "^2.1.0", "should": "^13.2.3", "sinon": "~7.5.0", - "smtp-server": "~3.9.0", + "smtp-server": "^3.9.0", "supertest": "^4.0.2", "when": "^3.7.8" }, diff --git a/storage/mysql/68-mysql.js b/storage/mysql/68-mysql.js index c2a93ac9..7ef30e09 100644 --- a/storage/mysql/68-mysql.js +++ b/storage/mysql/68-mysql.js @@ -121,6 +121,7 @@ module.exports = function(RED) { if (done) { done(); } return } + var bind = []; if (Array.isArray(msg.payload)) { bind = msg.payload; @@ -137,36 +138,15 @@ module.exports = function(RED) { node.error(err, msg); } else { - // if (rows.constructor.name === "OkPacket") { - // msg.payload = JSON.parse(JSON.stringify(rows)); - // } - // else if (rows.constructor.name === "Array") { - // if (rows[0] && rows[0].constructor.name === "RowDataPacket") { - // msg.payload = rows.map(v => Object.assign({}, v)); - // } - // else if (rows[0] && rows[0].constructor.name === "Array") { - // if (rows[0][0] && rows[0][0].constructor.name === "RowDataPacket") { - // msg.payload = rows.map(function(v) { - // if (!Array.isArray(v)) { return v; } - // v.map(w => Object.assign({}, w)) - // }); - // } - // else { msg.payload = rows; } - // } - // else { msg.payload = rows; } - // } - // else { msg.payload = rows; } msg.payload = rows; send(msg); status = { fill: "green", shape: "dot", text: RED._("mysql.status.ok") }; node.status(status); } if (done) { done(); } - // if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) { - // node.mydbConfig.connection.release(); - // } }); }) + } else { if (typeof msg.topic !== 'string') { node.error("msg.topic : "+RED._("mysql.errors.notstring")); done(); } diff --git a/storage/mysql/locales/ja/68-mysql.html b/storage/mysql/locales/ja/68-mysql.html index 9954b6c3..184ed3f1 100644 --- a/storage/mysql/locales/ja/68-mysql.html +++ b/storage/mysql/locales/ja/68-mysql.html @@ -2,7 +2,7 @@