From dec8f3a42581b9d1fea3681304bfb1cf39f237c9 Mon Sep 17 00:00:00 2001 From: Connor Roberts Date: Mon, 19 Jan 2015 01:02:51 +0000 Subject: [PATCH] Fix issue #114 Added the changes made in the Arduino plugin by tjanson to the RGB Light plugin to make it work again --- plugins/rgblights/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/rgblights/index.js b/plugins/rgblights/index.js index d5d08aa..316f0b1 100644 --- a/plugins/rgblights/index.js +++ b/plugins/rgblights/index.js @@ -22,6 +22,15 @@ define([ 'duino' ], function(duino) { this.id = this.name.toLowerCase(); this.board = new duino.Board(); + function warnNoDuino(e) { + console.warn("[WARNING] error while trying to connect to Arduino:") + console.warn(" >>> " + e); + console.info("[INFO] continuing and hoping for the best..."); + // FIXME: we should disable this plugin in some way, though + } + this.board.on('error', warnNoDuino); + this.board.setup(); + this.pins = {}; this.pluginHelper = app.get('plugin helper');