Hue update to match the new UI (Lux Bulb)

This commit is contained in:
Juan Pablo Risso
2015-09-08 13:54:31 -04:00
parent 35a7a79073
commit 1b424a8ea8

View File

@@ -20,23 +20,40 @@ metadata {
// TODO: define status and reply messages here // TODO: define status and reply messages here
} }
standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) { tiles(scale: 2) {
state "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821" multiAttributeTile(name:"rich-control", type: "lighting", canChangeIcon: true){
state "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff" tileAttribute ("device.switch", key: "PRIMARY_CONTROL") {
} attributeState "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") { attributeState "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" attributeState "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
} attributeState "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") { }
state "level", action:"switch level.setLevel" tileAttribute ("device.level", key: "SLIDER_CONTROL") {
} attributeState "level", action:"switch level.setLevel", range:"(0..100)"
valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") { }
state "level", label: 'Level ${currentValue}%' tileAttribute ("device.level", key: "SECONDARY_CONTROL") {
} attributeState "level", label: 'Level ${currentValue}%'
}
}
main(["switch"]) standardTile("switch", "device.switch", width: 2, height: 2, canChangeIcon: true) {
details(["switch", "levelSliderControl", "refresh"]) state "on", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
state "off", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
state "turningOn", label:'${name}', action:"switch.off", icon:"st.lights.philips.hue-single", backgroundColor:"#79b821", nextState:"turningOff"
state "turningOff", label:'${name}', action:"switch.on", icon:"st.lights.philips.hue-single", backgroundColor:"#ffffff", nextState:"turningOn"
}
controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 2, inactiveLabel: false, range:"(0..100)") {
state "level", action:"switch level.setLevel"
}
standardTile("refresh", "device.switch", inactiveLabel: false, height: 2, width: 2, decoration: "flat") {
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}
main(["switch"])
details(["rich-control", "refresh"])
}
} }
// parse events into attributes // parse events into attributes