Created
September 10, 2013 12:24
-
-
Save aurman/6508665 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata { | |
// simulator metadata | |
simulator { | |
// status messages | |
// none | |
// reply messages | |
reply "'on','delay 2000','off'": "switch:off" | |
} | |
// UI tile definitions | |
tiles { | |
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { | |
state "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState: "on" | |
state "on", label: '${name}', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821" | |
} | |
main "switch" | |
details "switch" | |
} | |
} | |
def parse(String description) { | |
def pair = description.split(":") | |
createEvent(name: pair[0].trim(), value: pair[1].trim()) | |
} | |
def push() { | |
['on','delay 2000','off'] | |
} | |
def off() { | |
'off' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment