@@ -985,7 +985,7 @@ define(['app'], function (app) {
985
985
}
986
986
var CustomImage = 0 ;
987
987
988
- if ( ( switchtype == 0 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
988
+ if ( ( switchtype == 0 ) || ( switchtype == 7 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
989
989
var cval = $ ( '#lightcontent #comboswitchicon' ) . data ( 'ddslick' ) . selectedIndex ;
990
990
CustomImage = $ . ddData [ cval ] . value ;
991
991
}
@@ -1605,7 +1605,7 @@ define(['app'], function (app) {
1605
1605
$ ( "#lightcontent #ondelay" ) . val ( addjvalue2 ) ;
1606
1606
}
1607
1607
1608
- if ( ( switchtype == 0 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
1608
+ if ( ( switchtype == 0 ) || ( switchtype == 7 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
1609
1609
$ ( "#lightcontent #SwitchIconDiv" ) . show ( ) ;
1610
1610
}
1611
1611
if ( switchtype == 18 ) {
@@ -1629,7 +1629,7 @@ define(['app'], function (app) {
1629
1629
$ ( "#lightcontent #offdelay" ) . val ( addjvalue ) ;
1630
1630
$ ( "#lightcontent #ondelay" ) . val ( addjvalue2 ) ;
1631
1631
}
1632
- if ( ( switchtype == 0 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
1632
+ if ( ( switchtype == 0 ) || ( switchtype == 7 ) || ( switchtype == 17 ) || ( switchtype == 18 ) ) {
1633
1633
$ ( "#lightcontent #SwitchIconDiv" ) . show ( ) ;
1634
1634
}
1635
1635
if ( switchtype == 18 ) {
@@ -2172,6 +2172,8 @@ define(['app'], function (app) {
2172
2172
}
2173
2173
else if ( item . SwitchType == "Dimmer" ) {
2174
2174
isdimmer = true ;
2175
+ if ( item . CustomImage == 0 ) item . Image = item . TypeImg ;
2176
+ item . Image = item . Image . charAt ( 0 ) . toUpperCase ( ) + item . Image . slice ( 1 ) ;
2175
2177
if (
2176
2178
( item . Status == 'On' ) ||
2177
2179
( item . Status == 'Chime' ) ||
@@ -2185,7 +2187,7 @@ define(['app'], function (app) {
2185
2187
img = '<img src="images/RGB48_On.png" onclick="ShowRGBWPopup(event, ' + item . idx + ', \'RefreshLights\',' + item . Protected + ',' + item . MaxDimLevel + ',' + item . LevelInt + ',' + item . Hue + ');" class="lcursor" height="48" width="48">' ;
2186
2188
}
2187
2189
else {
2188
- img = '<img src="images/Dimmer48_On. png" title="' + $ . t ( "Turn Off" ) + '" onclick="SwitchLight(' + item . idx + ',\'Off\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48">' ;
2190
+ img = '<img src="images/' + item . Image + '48_On. png" title="' + $ . t ( "Turn Off" ) + '" onclick="SwitchLight(' + item . idx + ',\'Off\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48">' ;
2189
2191
}
2190
2192
}
2191
2193
else {
@@ -2196,7 +2198,7 @@ define(['app'], function (app) {
2196
2198
img = '<img src="images/RGB48_Off.png" onclick="ShowRGBWPopup(event, ' + item . idx + ',\'RefreshLights\',' + item . Protected + ',' + item . MaxDimLevel + ',' + item . LevelInt + ',' + item . Hue + ');" class="lcursor" height="48" width="48">' ;
2197
2199
}
2198
2200
else {
2199
- img = '<img src="images/Dimmer48_Off. png" title="' + $ . t ( "Turn On" ) + '" onclick="SwitchLight(' + item . idx + ',\'On\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48">' ;
2201
+ img = '<img src="images/' + item . Image + '48_Off. png" title="' + $ . t ( "Turn On" ) + '" onclick="SwitchLight(' + item . idx + ',\'On\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48">' ;
2200
2202
}
2201
2203
}
2202
2204
}
@@ -2716,6 +2718,8 @@ define(['app'], function (app) {
2716
2718
}
2717
2719
else if ( item . SwitchType == "Dimmer" ) {
2718
2720
bIsDimmer = true ;
2721
+ if ( item . CustomImage == 0 ) item . Image = item . TypeImg ;
2722
+ item . Image = item . Image . charAt ( 0 ) . toUpperCase ( ) + item . Image . slice ( 1 ) ;
2719
2723
if (
2720
2724
( item . Status == 'On' ) ||
2721
2725
( item . Status == 'Chime' ) ||
@@ -2729,7 +2733,7 @@ define(['app'], function (app) {
2729
2733
xhtm += '\t <td id="img"><img src="images/RGB48_On.png" onclick="ShowRGBWPopup(event, ' + item . idx + ', \'RefreshLights\',' + item . Protected + ',' + item . MaxDimLevel + ',' + item . LevelInt + ',' + item . Hue + ');" class="lcursor" height="48" width="48"></td>\n' ;
2730
2734
}
2731
2735
else {
2732
- xhtm += '\t <td id="img"><img src="images/Dimmer48_On. png" title="' + $ . t ( "Turn Off" ) + '" onclick="SwitchLight(' + item . idx + ',\'Off\',\'RefreshLights\',' + item . Protected + ');" class="lcursor" height="48" width="48"></td>\n' ;
2736
+ xhtm += '\t <td id="img"><img src="images/' + item . Image + '48_On. png" title="' + $ . t ( "Turn Off" ) + '" onclick="SwitchLight(' + item . idx + ',\'Off\',\'RefreshLights\',' + item . Protected + ');" class="lcursor" height="48" width="48"></td>\n' ;
2733
2737
}
2734
2738
}
2735
2739
else {
@@ -2740,7 +2744,7 @@ define(['app'], function (app) {
2740
2744
xhtm += '\t <td id="img"><img src="images/RGB48_Off.png" onclick="ShowRGBWPopup(event, ' + item . idx + ',\'RefreshLights\',' + item . Protected + ',' + item . MaxDimLevel + ',' + item . LevelInt + ',' + item . Hue + ');" class="lcursor" height="48" width="48"></td>\n' ;
2741
2745
}
2742
2746
else {
2743
- xhtm += '\t <td id="img"><img src="images/Dimmer48_Off. png" title="' + $ . t ( "Turn On" ) + '" onclick="SwitchLight(' + item . idx + ',\'On\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48"></td>\n' ;
2747
+ xhtm += '\t <td id="img"><img src="images/' + item . Image + '48_Off. png" title="' + $ . t ( "Turn On" ) + '" onclick="SwitchLight(' + item . idx + ',\'On\',RefreshLights,' + item . Protected + ');" class="lcursor" height="48" width="48"></td>\n' ;
2744
2748
}
2745
2749
}
2746
2750
}
@@ -3005,8 +3009,9 @@ define(['app'], function (app) {
3005
3009
var obj = $ ( id ) ;
3006
3010
if ( typeof obj != 'undefined' ) {
3007
3011
var img = "" ;
3008
- var imgname = "Dimmer48_O" ;
3009
- if ( dtype == "relay" )
3012
+ var imgname = $ ( '#' + idx + ' .lcursor' ) . prop ( 'src' ) ;
3013
+ imgname = imgname . substring ( imgname . lastIndexOf ( "/" ) + 1 , imgname . lastIndexOf ( "_O" ) + 2 ) ;
3014
+ if ( dtype == "relay" )
3010
3015
imgname = "Fireplace48_O"
3011
3016
var bigtext ;
3012
3017
if ( fPercentage == 0 )
0 commit comments