mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-21 13:10:51 +00:00
Modifying 'Home Remote'
This commit is contained in:
@@ -698,36 +698,35 @@ void executeCommand() {
|
|||||||
if (deviceId) {
|
if (deviceId) {
|
||||||
def devices = getDevices(capability)
|
def devices = getDevices(capability)
|
||||||
def command
|
def command
|
||||||
def valueIsParamter = false
|
def valueIsParameter = false
|
||||||
|
|
||||||
switch (attribute) {
|
switch (attribute) {
|
||||||
case "hue":
|
case "hue":
|
||||||
command = "setHue"
|
command = "setHue"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "saturation":
|
case "saturation":
|
||||||
command = "setSaturation"
|
command = "setSaturation"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "color":
|
case "color":
|
||||||
command = "setColor"
|
command = "setColor"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "level":
|
case "level":
|
||||||
command = "setLevel"
|
command = "setLevel"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "heatingSetpoint":
|
case "heatingSetpoint":
|
||||||
command = "setHeatingSetpoint"
|
command = "setHeatingSetpoint"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "coolingSetpoint":
|
case "coolingSetpoint":
|
||||||
command = "setCoolingSetpoint"
|
command = "setCoolingSetpoint"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "currentActivity":
|
case "currentActivity":
|
||||||
command = "startActivity"
|
command = "startActivity"
|
||||||
valueIsParamter = true
|
valueIsParameter = true
|
||||||
break
|
break
|
||||||
case "door":
|
case "door":
|
||||||
command = getDoorControlCommand(value)
|
command = getDoorControlCommand(value)
|
||||||
@@ -750,9 +749,8 @@ void executeCommand() {
|
|||||||
command = getContactCommand(value)
|
command = getContactCommand(value)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
result = value
|
command = value
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the switch supports the specified command
|
// check that the switch supports the specified command
|
||||||
// If not, return an error using httpError, providing a HTTP status code.
|
// If not, return an error using httpError, providing a HTTP status code.
|
||||||
devices.each {
|
devices.each {
|
||||||
@@ -760,7 +758,7 @@ void executeCommand() {
|
|||||||
if (!it.hasCommand(command)) {
|
if (!it.hasCommand(command)) {
|
||||||
httpError(501, "$command is not a valid command for all devices specified")
|
httpError(501, "$command is not a valid command for all devices specified")
|
||||||
}
|
}
|
||||||
if(valueIsParamter){
|
if(valueIsParameter){
|
||||||
it."$command"(value)
|
it."$command"(value)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
Reference in New Issue
Block a user