From 9059718818fc1e9e1f078f4c5b0161e16d817af1 Mon Sep 17 00:00:00 2001 From: Yaima Valdivia Date: Tue, 1 Dec 2015 10:48:15 -0800 Subject: [PATCH] Implemented toggle() for locks https://smartthings.atlassian.net/browse/DVCSMP-672 --- .../smartthings/button-controller.src/button-controller.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smartapps/smartthings/button-controller.src/button-controller.groovy b/smartapps/smartthings/button-controller.src/button-controller.groovy index 1f99b08..4759e54 100644 --- a/smartapps/smartthings/button-controller.src/button-controller.groovy +++ b/smartapps/smartthings/button-controller.src/button-controller.groovy @@ -246,6 +246,9 @@ def toggle(devices) { else if (devices*.currentValue('lock').contains('locked')) { devices.unlock() } + else if (devices*.currentValue('lock').contains('unlocked')) { + devices.lock() + } else if (devices*.currentValue('alarm').contains('off')) { devices.siren() }