iobroker.lgtv11
Version:
ioBroker LG 11 SmartTV Adapter
160 lines (138 loc) • 5.81 kB
HTML
<html>
<link rel="stylesheet" type="text/css" href="../../lib/css/themes/jquery-ui/redmond/jquery-ui.min.css"/>
<script type="text/javascript" src="../../lib/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<script type="text/javascript" src="../../lib/js/jquery-ui-1.10.3.full.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/adapter.css"/>
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<script type="text/javascript">
var active = false;
systemDictionary = {
"Title": {"de": "LG 2011 SmartTV Adapter Konfiguration", "en": "LG 2011 SmartTV Adapter Configuration", "ru": "LG 2011 SmartTV Adapter Configuration"},
"IP": {
"de": "IP Adresse des LG SmartTV:",
"en": "IP address of the LG SmartTV:",
"ru": "IP address of the LG SmartTV:"
},
"Port": {
"de": "Port des LG SmartTV:",
"en": "Port of the LG SmartTV:",
"ru": "Port of the LG SmartTV:"
},
"Info": {
"de": "Hinweis",
"en": "Note",
"ru": "Note"
},
"PairingKey": {
"de": "Pairing-Schlüssel:",
"en": "Pairing Key:",
"ru": "Pairing Key:"
},
"Channel poll interval": {
"de": "Abfrage-Intervall für Kanal in ms:",
"en": "Channel poll interval in ms:",
"ru": "Интервал опроса канала в мс:"
},
"RequestKey": {
"de": "Pairing-Schlüssel anfordern",
"en": "Request Pairing Key",
"ru": "Request Pairing Key"
},
"Settings": {
"de": "Einstellungen",
"en": "Settings",
"ru": "Настройки"
},
"InfoMessage": {
"de": "Bitte die IP-Adresse des LG SMart-TVs eingeben, ggf. den Port ändern und auf \"Pairing-Schlüssel anfordern\" klicken.<br/>Den am eingeschalteten TV angezeigten Schlüssel unter \"Pairing-Schlüssel\" eintragen.",
"en": "Please enter the IP adress of the LG SMart-TV, change the port if necessary and click \"Request Pairing Key\".<br/>On the powered-on TV you\'ll see the pairing key which should be entered under \"Pairing Key\"",
"ru": "Please enter the IP adress of the LG SMart-TV, change the port if necessary and click \"Request Pairing Key\".<br/>On the powered-on TV you\'ll see the pairing key which should be entered under \"Pairing Key\""
}
};
function load(settings, onChange) {
socket.emit('getState', 'system.adapter.' + adapter + '.' + instance + '.alive', function (err, state) {
active = (state && state.val);
});
$('#find').button().click(function ()
{
if (!active)
showMessage(_(translateWord('Please enable the adapter')), 'Warning', 'info');
else
sendTo('lgtv11.' + instance, 'RequestPairingKey_Msg', 5000, function (result) {});
});
for (var key in settings) {
if ($('#' + key + '.value').attr('type') == 'checkbox') {
$('#' + key + '.value').prop('checked', settings[key]).change(function () {
onChange();
});
} else {
$('#' + key + '.value').val(settings[key]).change(function () {
onChange();
}).keyup(function () {
$(this).trigger('change');
});
}
}
onChange(false);
}
function save(callback) {
var obj = {};
$('.value').each(function () {
var $this = $(this);
var id = $this.attr('id');
if ($this.attr('type') == 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
<style>
td {
font-size: 13px;
padding-left:1px;
padding-right: 4px;
padding-top: 3px;
padding-bottom: 3px;
}
input {
font-size: 13px;
}
h1 {
font-size: 11px;
color: #505050;
font-weight: bold;
width: 100%;
padding-left:6px;
padding-right: 5px;
padding-top: 5px;
padding-bottom: 5px;
background-color: #e0e0e0;
/*background-image: linear-gradient(to right, #e0e0e0, rgba(224,224,224,0.0));*/
/*background-image: linear-gradient(to right, #e0e0e0, #e8e8e8 50%, #e0e0e0);*/
}
</style>
<div id="adapter-container" style="padding-left: 6px; padding-right: 0px; width: 97%;">
<table>
<td><img src="lgtv2011.png" /></td>
<td style="padding-top: 20px;padding-left: 10px"><h3 class="translate">Title</h3></td>
</table>
<h1 class="translate">Settings</h1>
<table>
<tr><td class="translate">IP</td><td><input class="value" id="ip" type="input" size="15" required /></td></tr>
<tr><td class="translate">Port</td><td><input class="value" id="port" type="input" size="15" required /></td></tr>
<tr><td class="translate">PairingKey</td><td><input class="value" id="pairingkey" type="input" size="15" /></td></tr>
<tr><td class="translate">Channel poll interval</td><td><input class="value" id="interval" type="input" size="15" required /></td></tr>
<tr><td><button id="find"><span class="translate">RequestKey</span></button></td><tr>
</table>
<div style="padding: 10px"></div>
<h1 class="translate">Info</h1>
<table>
</div>
</table>
<h3 class="translate">InfoMessage</h3>
</html>