From 66814dc59f1e3a67930000b5f910c89727ef8852 Mon Sep 17 00:00:00 2001 From: Rahmadi Trimananda Date: Fri, 9 Aug 2019 10:36:37 -0700 Subject: [PATCH 1/1] Update Switches.groovy --- third-party/Switches.groovy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/third-party/Switches.groovy b/third-party/Switches.groovy index ba2d817..9629299 100755 --- 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("Change to this mode") { + input "newMode", "mode", title: "Mode?" + } } } @@ -52,8 +55,9 @@ def switchHandler(evt) { 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) } } -- 2.34.1