@@ -19,24 +19,41 @@ metadata {
19
19
simulator {
20
20
// TODO: define status and reply messages here
21
21
}
22
+
23
+ tiles(scale : 2 ) {
24
+ multiAttributeTile(name :" rich-control" , type : " lighting" , canChangeIcon : true ){
25
+ tileAttribute (" device.switch" , key : " PRIMARY_CONTROL" ) {
26
+ attributeState " on" , label :' ${name}' , action :" switch.off" , icon :" st.lights.philips.hue-single" , backgroundColor :" #79b821" , nextState :" turningOff"
27
+ attributeState " off" , label :' ${name}' , action :" switch.on" , icon :" st.lights.philips.hue-single" , backgroundColor :" #ffffff" , nextState :" turningOn"
28
+ attributeState " turningOn" , label :' ${name}' , action :" switch.off" , icon :" st.lights.philips.hue-single" , backgroundColor :" #79b821" , nextState :" turningOff"
29
+ attributeState " turningOff" , label :' ${name}' , action :" switch.on" , icon :" st.lights.philips.hue-single" , backgroundColor :" #ffffff" , nextState :" turningOn"
30
+ }
31
+ tileAttribute (" device.level" , key : " SLIDER_CONTROL" ) {
32
+ attributeState " level" , action :" switch level.setLevel" , range :" (0..100)"
33
+ }
34
+ tileAttribute (" device.level" , key : " SECONDARY_CONTROL" ) {
35
+ attributeState " level" , label : ' Level ${currentValue}%'
36
+ }
37
+ }
38
+
39
+ standardTile(" switch" , " device.switch" , width : 2 , height : 2 , canChangeIcon : true ) {
40
+ state " on" , label :' ${name}' , action :" switch.off" , icon :" st.lights.philips.hue-single" , backgroundColor :" #79b821" , nextState :" turningOff"
41
+ state " off" , label :' ${name}' , action :" switch.on" , icon :" st.lights.philips.hue-single" , backgroundColor :" #ffffff" , nextState :" turningOn"
42
+ state " turningOn" , label :' ${name}' , action :" switch.off" , icon :" st.lights.philips.hue-single" , backgroundColor :" #79b821" , nextState :" turningOff"
43
+ state " turningOff" , label :' ${name}' , action :" switch.on" , icon :" st.lights.philips.hue-single" , backgroundColor :" #ffffff" , nextState :" turningOn"
44
+ }
45
+
46
+ controlTile(" levelSliderControl" , " device.level" , " slider" , height : 1 , width : 2 , inactiveLabel : false , range :" (0..100)" ) {
47
+ state " level" , action :" switch level.setLevel"
48
+ }
49
+
50
+ standardTile(" refresh" , " device.switch" , inactiveLabel : false , height : 2 , width : 2 , decoration : " flat" ) {
51
+ state " default" , label :" " , action :" refresh.refresh" , icon :" st.secondary.refresh"
52
+ }
22
53
23
- standardTile(" switch" , " device.switch" , width : 2 , height : 2 , canChangeIcon : true ) {
24
- state " on" , label :' ${name}' , action :" switch.off" , icon :" st.lights.philips.hue-single" , backgroundColor :" #79b821"
25
- state " off" , label :' ${name}' , action :" switch.on" , icon :" st.lights.philips.hue-single" , backgroundColor :" #ffffff"
26
- }
27
- standardTile(" refresh" , " device.switch" , inactiveLabel : false , decoration : " flat" ) {
28
- state " default" , label :" " , action :" refresh.refresh" , icon :" st.secondary.refresh"
29
- }
30
- controlTile(" levelSliderControl" , " device.level" , " slider" , height : 1 , width : 2 , inactiveLabel : false , range :" (0..100)" ) {
31
- state " level" , action :" switch level.setLevel"
32
- }
33
- valueTile(" level" , " device.level" , inactiveLabel : false , decoration : " flat" ) {
34
- state " level" , label : ' Level ${currentValue}%'
35
- }
36
-
37
- main([" switch" ])
38
- details([" switch" , " levelSliderControl" , " refresh" ])
39
-
54
+ main([" switch" ])
55
+ details([" rich-control" , " refresh" ])
56
+ }
40
57
}
41
58
42
59
// parse events into attributes
0 commit comments