mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix unicorn hat command check
This commit is contained in:
parent
f033a383b9
commit
8f17072176
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-pi-unicorn-hat",
|
||||
"version" : "0.0.17",
|
||||
"version" : "0.0.18",
|
||||
"description" : "A Node-RED node to output to a Raspberry Pi Unicorn HAT from Pimorini.",
|
||||
"dependencies" : {
|
||||
"pngjs": "2.2.*"
|
||||
|
@ -7,7 +7,7 @@ module.exports = function(RED) {
|
||||
var execSync = require('child_process').execSync;
|
||||
|
||||
var hatCommand = __dirname+'/unihat';
|
||||
var allOK = true;
|
||||
var allOK = true;
|
||||
|
||||
try {
|
||||
var cpuinfo = fs.readFileSync("/proc/cpuinfo").toString();
|
||||
@ -19,7 +19,7 @@ module.exports = function(RED) {
|
||||
RED.log.warn("rpi-unicorn : "+RED._("node-red:rpi-gpio.errors.libnotfound"));
|
||||
allOK = false;
|
||||
}
|
||||
else if (!(1 & parseInt ((fs.statSync(gpioCommand).mode & parseInt ("777", 8)).toString (8)[0]))) {
|
||||
else if (!(1 & parseInt ((fs.statSync(hatCommand).mode & parseInt ("777", 8)).toString (8)[0]))) {
|
||||
RED.log.warn("rpi-unicorn : "+RED._("node-red:rpi-gpio.errors.needtobeexecutable",{command:hatCommand}));
|
||||
allOK = false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user