1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

let Hypriot on Pi detect gpio correctly

clean up duplicate labels
This commit is contained in:
Dave Conway-Jones 2017-02-07 20:32:51 +00:00
parent 7029541b4f
commit 1d15ee7034
2 changed files with 7 additions and 5 deletions

View File

@ -218,7 +218,6 @@
var pinsInUse = {}; var pinsInUse = {};
RED.nodes.registerType('rpi-gpio out',{ RED.nodes.registerType('rpi-gpio out',{
category: 'Raspberry Pi', category: 'Raspberry Pi',
label: 'Raspberry Pi',
color:"#c6dbef", color:"#c6dbef",
defaults: { defaults: {
name: { value:"" }, name: { value:"" },
@ -351,7 +350,6 @@
<script type="text/javascript"> <script type="text/javascript">
RED.nodes.registerType('rpi-mouse',{ RED.nodes.registerType('rpi-mouse',{
category: 'Raspberry Pi', category: 'Raspberry Pi',
label: 'Raspberry Pi',
color:"#c6dbef", color:"#c6dbef",
defaults: { defaults: {
name: { value:"" }, name: { value:"" },
@ -390,7 +388,6 @@
<script type="text/javascript"> <script type="text/javascript">
RED.nodes.registerType('rpi-keyboard',{ RED.nodes.registerType('rpi-keyboard',{
category: 'Raspberry Pi', category: 'Raspberry Pi',
label: 'Raspberry Pi',
color:"#c6dbef", color:"#c6dbef",
defaults: { defaults: {
name: { value:"" } name: { value:"" }

View File

@ -36,11 +36,16 @@ module.exports = function(RED) {
try { try {
fs.statSync("/usr/lib/python2.7/site-packages/RPi/GPIO"); // test on Arch fs.statSync("/usr/lib/python2.7/site-packages/RPi/GPIO"); // test on Arch
} }
catch(err) {
try {
fs.statSync("/usr/lib/python2.7/dist-packages/RPi/GPIO"); // test on Hypriot
}
catch(err) { catch(err) {
RED.log.warn(RED._("rpi-gpio.errors.libnotfound")); RED.log.warn(RED._("rpi-gpio.errors.libnotfound"));
throw "Warning : "+RED._("rpi-gpio.errors.libnotfound"); throw "Warning : "+RED._("rpi-gpio.errors.libnotfound");
} }
} }
}
if ( !(1 & parseInt((fs.statSync(gpioCommand).mode & parseInt("777", 8)).toString(8)[0]) )) { if ( !(1 & parseInt((fs.statSync(gpioCommand).mode & parseInt("777", 8)).toString(8)[0]) )) {
RED.log.error(RED._("rpi-gpio.errors.needtobeexecutable",{command:gpioCommand})); RED.log.error(RED._("rpi-gpio.errors.needtobeexecutable",{command:gpioCommand}));