From 32e3916a85135ef456efcb35d5509d1abf1b52ce Mon Sep 17 00:00:00 2001 From: Bill Venhaus Date: Sun, 4 Oct 2015 21:53:55 -0500 Subject: [PATCH] Modifying 'Home Remote' --- .../home-remote.src/home-remote.groovy | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/smartapps/thehomeremote-homeremote/home-remote.src/home-remote.groovy b/smartapps/thehomeremote-homeremote/home-remote.src/home-remote.groovy index e040328..b41d3d5 100644 --- a/smartapps/thehomeremote-homeremote/home-remote.src/home-remote.groovy +++ b/smartapps/thehomeremote-homeremote/home-remote.src/home-remote.groovy @@ -698,36 +698,35 @@ void executeCommand() { if (deviceId) { def devices = getDevices(capability) def command - def valueIsParamter = false - + def valueIsParameter = false switch (attribute) { case "hue": command = "setHue" - valueIsParamter = true + valueIsParameter = true break case "saturation": command = "setSaturation" - valueIsParamter = true + valueIsParameter = true break case "color": command = "setColor" - valueIsParamter = true + valueIsParameter = true break case "level": command = "setLevel" - valueIsParamter = true + valueIsParameter = true break case "heatingSetpoint": command = "setHeatingSetpoint" - valueIsParamter = true + valueIsParameter = true break case "coolingSetpoint": command = "setCoolingSetpoint" - valueIsParamter = true + valueIsParameter = true break case "currentActivity": command = "startActivity" - valueIsParamter = true + valueIsParameter = true break case "door": command = getDoorControlCommand(value) @@ -750,9 +749,8 @@ void executeCommand() { command = getContactCommand(value) break default: - result = value + command = value } - // check that the switch supports the specified command // If not, return an error using httpError, providing a HTTP status code. devices.each { @@ -760,7 +758,7 @@ void executeCommand() { if (!it.hasCommand(command)) { httpError(501, "$command is not a valid command for all devices specified") } - if(valueIsParamter){ + if(valueIsParameter){ it."$command"(value) } else{