From 211eeea05d9d92ccc33d49e6c95e05c3206713ed Mon Sep 17 00:00:00 2001 From: HirokiUchikawa Date: Fri, 19 Oct 2018 17:52:57 +0900 Subject: [PATCH 1/2] Set min value of properties and spinners for batch --- nodes/core/logic/19-batch.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/nodes/core/logic/19-batch.html b/nodes/core/logic/19-batch.html index 05aafe61a..beb99747c 100644 --- a/nodes/core/logic/19-batch.html +++ b/nodes/core/logic/19-batch.html @@ -100,9 +100,9 @@ defaults: { name: {value:""}, mode: {value:"count"}, - count: {value:10}, - overlap: {value:0}, - interval: {value:10}, + count: {value:10,validate:function(v) { return RED.validators.number(v) && (v >= 1); }}, + overlap: {value:0,validate:function(v) { return RED.validators.number(v) && (v >= 0); }}, + interval: {value:10,validate:function(v) { return RED.validators.number(v) && (v >= 1); }}, allowEmptySequence: {value:false}, topics: {value:[{topic:""}]} }, @@ -149,12 +149,9 @@ removable: true }); - $("#node-input-count").spinner({ - }); - $("#node-input-overlap").spinner({ - }); - $("#node-input-interval").spinner({ - }); + $("#node-input-count").spinner({min:1}); + $("#node-input-overlap").spinner({min:0}); + $("#node-input-interval").spinner({min:1}); $("#node-input-mode").change(function(e) { var val = $(this).val(); $(".node-row-msg-count").toggle(val==="count"); From 4f87ebdf0a3e20f14559fa6a87b888091ca37454 Mon Sep 17 00:00:00 2001 From: Nephiel Date: Wed, 24 Oct 2018 00:20:44 +0200 Subject: [PATCH 2/2] Recognize pip installs of RPi.GPIO (#1934) Fixes "[warn] rpi-gpio : Cannot find Pi RPi.GPIO python library" when it is installed with pip using the default prefix (/usr/local). --- nodes/core/hardware/36-rpi-gpio.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nodes/core/hardware/36-rpi-gpio.js b/nodes/core/hardware/36-rpi-gpio.js index 0a21f578a..9afcd40dd 100644 --- a/nodes/core/hardware/36-rpi-gpio.js +++ b/nodes/core/hardware/36-rpi-gpio.js @@ -24,8 +24,12 @@ module.exports = function(RED) { try { fs.statSync("/usr/lib/python2.7/dist-packages/RPi/GPIO"); // test on Hypriot } catch(err) { - RED.log.warn("rpi-gpio : "+RED._("rpi-gpio.errors.libnotfound")); - allOK = false; + try { + fs.statSync("/usr/local/lib/python2.7/dist-packages/RPi/GPIO"); // installed with pip + } catch(err) { + RED.log.warn("rpi-gpio : "+RED._("rpi-gpio.errors.libnotfound")); + allOK = false; + } } } }