projects
/
smartapps.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
08ec546
)
Update Switches.groovy
author
Rahmadi Trimananda
<rahmadi.trimananda@uci.edu>
Fri, 9 Aug 2019 17:36:37 +0000
(10:36 -0700)
committer
GitHub Enterprise
<noreply@github.uci.edu>
Fri, 9 Aug 2019 17:36:37 +0000
(10:36 -0700)
third-party/Switches.groovy
patch
|
blob
|
history
diff --git
a/third-party/Switches.groovy
b/third-party/Switches.groovy
index ba2d817e3432d4c7481da99bd4b909bd55496a53..9629299765561421ead1ae0662fcd52a01433979 100755
(executable)
--- a/
third-party/Switches.groovy
+++ b/
third-party/Switches.groovy
@@
-30,6
+30,9
@@
def selectSwitches() {
section("Select switches named after Hello Home phrases") {
input "switches", "capability.switch", title: "Switches", multiple: true
}
section("Select switches named after Hello Home phrases") {
input "switches", "capability.switch", title: "Switches", multiple: true
}
+ section("Change to this mode") {
+ input "newMode", "mode", title: "Mode?"
+ }
}
}
}
}
@@
-52,8
+55,9
@@
def switchHandler(evt) {
if (phrase) {
location.helloHome.execute(phrase.label)
}
if (phrase) {
location.helloHome.execute(phrase.label)
}
- def mode = location.modes.find { it.name == s.displayName }
- if (mode) {
- setLocationMode(mode)
+ // This looks like a bug because device's displayName has nothing to do with modes
+ //def mode = location.modes.find { it.name == s.displayName }
+ if (newMode) {
+ setLocationMode(newMode)
}
}
}
}