From 4a14421ef063846dd5e9017d57b91a35c33e41c5 Mon Sep 17 00:00:00 2001 From: Tim Slagle Date: Wed, 1 Feb 2017 14:46:54 -0800 Subject: [PATCH] test: test --- .../stateless-on-off-button-tile.groovy | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 devicetypes/gouldner/stateless-on-off-button-tile.src/stateless-on-off-button-tile.groovy diff --git a/devicetypes/gouldner/stateless-on-off-button-tile.src/stateless-on-off-button-tile.groovy b/devicetypes/gouldner/stateless-on-off-button-tile.src/stateless-on-off-button-tile.groovy new file mode 100644 index 0000000..7082203 --- /dev/null +++ b/devicetypes/gouldner/stateless-on-off-button-tile.src/stateless-on-off-button-tile.groovy @@ -0,0 +1,46 @@ +/** + * Stateless On/Off Button Tile + * + * Author: Ronald Gouldner + * + * Date: 2015-05-14 + */ +metadata { + // Automatically generated. Make future change here. + definition (name: "Stateless On-Off Button Tile", namespace: "gouldner", author: "Ronald Gouldner") { + capability "Actuator" + capability "Switch" + capability "Sensor" + } + + // simulator metadata + simulator { + } + + // UI tile definitions + tiles { + standardTile("button", "device.switch", width: 2, height: 2, canChangeIcon: true) { + state "offReady", label: 'Off', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState: "onReady" + state "onReady", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821", nextState: "offReady" + state "off", label: 'Off', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff" + state "on", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" + } + main "button" + details "button" + } +} + +def parse(String description) { +} + +def on() { + log.debug "Stateless On/Off Button Tile Virtual Switch ${device.name} turned on" + sendEvent(name: "switch", value: "on") + sendEvent(name: "switch", value: "onReady") +} + +def off() { + log.debug "Stateless On/Off Button Tile Virtual Switch ${device.name} turned off" + sendEvent(name: "switch", value: "off") + sendEvent(name: "switch", value: "offReady") +} \ No newline at end of file