Skip to content

Commit

Permalink
settings_loxone.js: No not re-enable "Default" output on On-Off-On
Browse files Browse the repository at this point in the history
Fixes #31
  • Loading branch information
christianTF committed Nov 14, 2021
1 parent 119dc48 commit 4954eba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions webfrontend/htmlauth/js/settings_loxone.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ $(function() {
uid = $(target).closest('table').data("uid");
msno = $(target).closest('table').data("msno");
var control = controls.find( obj => { return obj.UID === uid && obj.msno == msno })

var stat = statsconfigLoxone.find(obj => {
return obj.uuid === control.UID && obj.msno == control.msno })
// Validations and changes of dependent inputs

if( target.id == "LoxoneDetails_s4lmeasurementname" ) {
Expand All @@ -93,7 +94,12 @@ $(function() {
// Activate interval field
$("#LoxoneDetails_s4lstatinterval").prop( "disabled", false ).textinput("refresh");
$('[name="LoxoneDetails_s4loutput"]').prop( "disabled", false );
$('[name="LoxoneDetails_s4loutput"][value="Default"').prop( "checked", true );

// Enable "Default" setting only when nothing else is activated
if( !stat ) {
// This element does not exist in stats.json yet, therefore enable "Default" on activation
$('[name="LoxoneDetails_s4loutput"][value="Default"').prop( "checked", true );
}
}
else {
// Disable interval field and outputs
Expand Down

0 comments on commit 4954eba

Please sign in to comment.