From daf64754a4700cc1eecc479b4658ef58f091890c Mon Sep 17 00:00:00 2001 From: rafale77 Date: Tue, 9 Mar 2021 16:07:40 -0800 Subject: [PATCH 1/2] A few fixes to ALTUI displays 1. Added slider to the Window Covering devices to represent and control open % 2. Make dimmable light sliders report current status instead of target which is of no significant use 3. Make RGB dimmable light display current color before target color. Particularly useful for plugins which do not use TargetColor variable (i.e ALTHUE) --- J_ALTUI_plugins.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/J_ALTUI_plugins.js b/J_ALTUI_plugins.js index 105ca15..955e1a7 100644 --- a/J_ALTUI_plugins.js +++ b/J_ALTUI_plugins.js @@ -176,6 +176,7 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { style += ".altui-dimmable-qubino-btn { padding: 3px 0px 0px 0px; height:25px;}"; style += ".altui-dimmable-qubino-btn-img { width:100%; height:100% }"; style += ".altui-dimmable-slider { margin-left: 60px; margin-right: 70px; margin-top:5px;}"; + style += ".altui-window-slider { margin-left: 60px; margin-right: 110px; margin-top:5px;}"; style += ".altui-colorpicker { margin-top: 2px; width:30px; margin-right: 15px; }"; style += ".altui-infoviewer-log-btn,.altui-infoviewer-btn,.altui-window-btn,.altui-datamine-open { margin-top: 10px; }"; style += ".altui-infoviewer-pattern { font-size: 14px; }"; @@ -689,11 +690,12 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { html += (" ").format( (status==0) ? 'active' : '' ); html += ""; html += ""; - + html += (""+status+"% "); + html += ("
").format(device.altuiid); html += ""; - return html; }; @@ -751,9 +753,9 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { // if (colorpicker!=true) // html += UIManager.defaultDeviceDrawWatts(device); // load level - var level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelTarget' )); - if (isNaN(level)==true) - level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); + var level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); + //if (isNaN(level)==true) + // level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); html += (""+level+"% "); @@ -776,8 +778,8 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { // "w,c,r,g,b" - w = warm white value, c = cool white value // "ct" - ct = color temperature value in Kelvin (integer between 2000 and 9000) - // try Target then Current - current = MultiBox.getStatus(device,'urn:micasaverde-com:serviceId:Color1','TargetColor') || MultiBox.getStatus(device,'urn:micasaverde-com:serviceId:Color1','CurrentColor'); + // try Current then Target + current = MultiBox.getStatus(device,'urn:micasaverde-com:serviceId:Color1','CurrentColor') || MultiBox.getStatus(device,'urn:micasaverde-com:serviceId:Color1','TargetColor'); if (current!=null) { var parts = current.split(","); // 0=0,1=0,2=0,3=0,4=255 // normalize the values @@ -1840,7 +1842,7 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { } html += " "+ ""; - } + } html += "
 
"+ "
"+ "
"+ From bf34215c49ea810a6236265d3f1d0a18c54920d4 Mon Sep 17 00:00:00 2001 From: rafale77 Date: Sat, 13 Mar 2021 13:25:49 -0800 Subject: [PATCH 2/2] Update J_ALTUI_plugins.js --- J_ALTUI_plugins.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/J_ALTUI_plugins.js b/J_ALTUI_plugins.js index 955e1a7..87af042 100644 --- a/J_ALTUI_plugins.js +++ b/J_ALTUI_plugins.js @@ -753,9 +753,9 @@ var ALTUI_PluginDisplays= ( function( window, undefined ) { // if (colorpicker!=true) // html += UIManager.defaultDeviceDrawWatts(device); // load level - var level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); - //if (isNaN(level)==true) - // level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); + var level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelTarget' )); + if (isNaN(level)==true) + level = parseInt(MultiBox.getStatus( device, 'urn:upnp-org:serviceId:Dimming1', 'LoadLevelStatus' )); html += (""+level+"% ");