Skip to content

Instantly share code, notes, and snippets.

@aurman
Created September 10, 2013 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurman/6508665 to your computer and use it in GitHub Desktop.
Save aurman/6508665 to your computer and use it in GitHub Desktop.
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