From f8e8bf22c0242e9c83e9dbee7febb66082637fa2 Mon Sep 17 00:00:00 2001 From: Nicholas O'Leary Date: Sat, 19 Oct 2013 21:04:17 +0100 Subject: [PATCH] SwitchNode: allow use of properties beneath the top level --- nodes/logic/10-switch.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nodes/logic/10-switch.js b/nodes/logic/10-switch.js index 489bd6ceb..f917819b3 100644 --- a/nodes/logic/10-switch.js +++ b/nodes/logic/10-switch.js @@ -39,14 +39,18 @@ function SwitchNode(n) { this.rules = n.rules; this.property = n.property; + var propertyParts = n.property.split("."); + var node = this; this.on('input',function(msg) { var onward = []; - + var prop = propertyParts.reduce(function(obj,i) { + return obj[i] + },msg); for (var i=0;i