Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for (var param in params) {
if (param == 'hm.host') continue;
var $this = $('[id="' + param + '"]');
if ($this.attr('type') == 'checkbox') {
if (params[param]) {
$this.attr('checked', true);
} else {
$this.removeAttr('checked');
}
} else {
$this.val(params[param]);
}
}
if (!params['mqtt.topic']) $('[id="mqtt.topic"]').val('hm/');
var hmhost = params['hm.host'].split(',');
if (hmhost.indexOf('127.0.0.1:2000') !== -1) {
$('#hs485d').attr('checked', true);
ifaces.hs485d = true;
} else {
$('#hs485d').removeAttr('checked');
ifaces.hs485d = false;
}
if (hmhost.indexOf('127.0.0.1:2001') !== -1) {
$('#rfd').attr('checked', true);
ifaces.rfd = true;
} else {
$('#rfd').removeAttr('checked');