catch possible non-property in BBB node

This commit is contained in:
Dave Conway-Jones 2016-01-29 20:07:17 +00:00
parent d7be242477
commit 9ba84c4908
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ module.exports = function (RED) {
bonescript.detachInterrupt(node._pin);
process.nextTick(function () {
setPinMode(node._pin, bonescript.INPUT, function (response, pin) {
if (response.value === true) {
if (response.hasOwnProperty("value") && response.value === true) {
bonescript.digitalRead(node._pin, function (err, x) {
// Initialise the currentState and lastActiveTime variables based on the value read
node.currentState = Number(x.value);

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-beaglebone",
"version" : "0.1.1",
"version" : "0.1.2",
"description" : "A set of Node-RED nodes to interface to the GPIO pins of a Beaglebone Black board",
"dependencies" : {
"octalbonescript":"^1.1.*"