node-red-node-pi-gpio 2.0.1 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/36-rpi-gpio.html CHANGED
@@ -1,5 +1,6 @@
1
1
  <style>
2
2
  .rpi-gpio-pinTable {
3
+ color: #555;
3
4
  width: 340px;
4
5
  display: inline-table;
5
6
  font-size: 13px;
package/36-rpi-gpio.js CHANGED
@@ -108,10 +108,12 @@ module.exports = function(RED) {
108
108
  delete pinsInUse[node.pin];
109
109
  if (node.child != null) {
110
110
  node.finished = done;
111
- node.child.stdin.write("close "+node.pin);
112
- node.child.kill('SIGKILL');
111
+ node.child.stdin.write("close "+node.pin, () => {
112
+ node.child.kill('SIGKILL');
113
+ setTimeout(function() { if (done) { done(); } }, 25);
114
+ });
113
115
  }
114
- else { done(); }
116
+ else { if (done) { done(); } }
115
117
  });
116
118
  }
117
119
  RED.nodes.registerType("rpi-gpio in",GPIOInNode);
@@ -210,10 +212,12 @@ module.exports = function(RED) {
210
212
  delete pinsInUse[node.pin];
211
213
  if (node.child != null) {
212
214
  node.finished = done;
213
- node.child.stdin.write("close "+node.pin);
214
- node.child.kill('SIGKILL');
215
+ node.child.stdin.write("close "+node.pin, () => {
216
+ node.child.kill('SIGKILL');
217
+ setTimeout(function() { if (done) { done(); } }, 25);
218
+ });
215
219
  }
216
- else { done(); }
220
+ else { if (done) { done(); } }
217
221
  });
218
222
 
219
223
  }
package/nrgpio CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  python_cmd='python3'
4
4
  # Fallback to Python 2, if Python 3 is not available
5
- command -v python3 > /dev/null || python_cmd=`python`
5
+ command -v python3 > /dev/null || python_cmd='python'
6
6
 
7
7
  BASEDIR=$(dirname $0)
8
8
  $python_cmd -u $BASEDIR/nrgpio.py $@
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-node-pi-gpio",
3
- "version": "2.0.1",
3
+ "version": "2.0.4",
4
4
  "description": "The basic Node-RED node for Pi GPIO",
5
5
  "dependencies" : {
6
6
  },
package/testgpio CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  python_cmd='python3'
4
4
  # Fallback to Python 2, if Python 3 is not available
5
- command -v python3 > /dev/null || python_cmd=`python`
5
+ command -v python3 > /dev/null || python_cmd='python'
6
6
 
7
7
  BASEDIR=$(dirname $0)
8
8
  $python_cmd -u $BASEDIR/testgpio.py $@