Skip to content

Commit

Permalink
fixed check for python2 module while using python3 (#866)
Browse files Browse the repository at this point in the history
Excellent - thank for that.
  • Loading branch information
mw75 authored Dec 12, 2021
1 parent 68ba586 commit 70ac424
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion hardware/neopixel/neopix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ python_cmd='python3'
command -v python3 > /dev/null || python_cmd=`python`

BASEDIR=$(dirname $0)
sudo $python_cmd -u $BASEDIR/neopix.py $@
if [ "$1" == "check" ];then
$python_cmd -c "import rpi_ws281x"
else
sudo $python_cmd -u $BASEDIR/neopix.py $@
fi
2 changes: 1 addition & 1 deletion hardware/neopixel/neopixel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(RED) {
RED.log.warn("rpi-neopixels : "+RED._("node-red:rpi-gpio.errors.ignorenode"));
allOK = false;
}
else if (execSync('python -c "import rpi_ws281x"').toString() !== "") {
else if (execSync(piCommand+" check").toString() !== "") {
RED.log.warn("rpi-neopixels : Can't find neopixel python library");
allOK = false;
}
Expand Down

0 comments on commit 70ac424

Please sign in to comment.