-
Notifications
You must be signed in to change notification settings - Fork 3
/
J_DeusExMachinaII1_ALTUI.js
35 lines (32 loc) · 1.46 KB
/
J_DeusExMachinaII1_ALTUI.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//# sourceURL=J_DeusExMachinaII1_ALTUI.js
/**
* J_DeusExMachinaII1_ALTUI.js
* Special presentation for ALTUI for DeusExMachinaII
*
* Copyright 2016,2017,2019,2022 Patrick H. Rigney, All Rights Reserved.
* This file is part of DeusExMachinaII. For license information, see LICENSE at https://github.com/toggledbits/DeusExMachina
*/
"use strict";
var DeusExMachina_ALTUI = ( function( window, undefined ) {
function _draw( device ) {
var html ="";
var message = MultiBox.getStatus( device, "urn:toggledbits-com:serviceId:DeusExMachinaII1", "Message");
var st = MultiBox.getStatus( device, "urn:upnp-org:serviceId:SwitchPower1", "Status");
html += '<div class="pull-left">';
html += message;
html += "</div>";
html += ALTUI_PluginDisplays.createOnOffButton( st, "toggledbits-deus-" + device.altuiid, _T("Disabled,Enabled"), "pull-right");
html += "<script type='text/javascript'>";
html += "$('div#toggledbits-deus-{0}').on('click', function() { DeusExMachina_ALTUI.toggleEnable('{0}','div#toggledbits-deus-{0}'); } );".format(device.altuiid);
html += "</script>";
return html;
}
return {
DeviceDraw: _draw,
toggleEnable: function (altuiid, htmlid) {
ALTUI_PluginDisplays.toggleButton(altuiid, htmlid, 'urn:upnp-org:serviceId:SwitchPower1', 'Status', function(id,newval) {
MultiBox.runActionByAltuiID( altuiid, 'urn:upnp-org:serviceId:SwitchPower1', 'SetTarget', {newTargetValue:newval} );
});
},
};
})( window );