Skip to content

Commit

Permalink
Fix display of PID widget
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Mar 29, 2024
1 parent b8bffb5 commit d66831a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mycodo/widgets/widget_pid.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def pid_mod_unique_id(unique_id, state):
} else if (document.getElementById(name + '-timestamp-' + widget_id)) {
document.getElementById(name + '-timestamp-' + widget_id).innerHTML = 'MAX AGE EXCEEDED';
}
if (document.getElementById(name + '-' + widget_id)) {
if (data[name][1] != null && document.getElementById(name + '-' + widget_id)) {
const value = parseFloat(data[name][1]).toFixed(decimal_places);
document.getElementById(name + '-' + widget_id).innerHTML = value + units;
} else if (document.getElementById(name + '-' + widget_id)) {
Expand Down Expand Up @@ -552,11 +552,11 @@ def pid_mod_unique_id(unique_id, state):
document.getElementById('button-hold-' + widget_id).style.display = "none";
document.getElementById('setpoint-' + widget_id).innerHTML = 'NONE';
document.getElementById('setpoint-timestamp-' + widget_id).innerHTML = 'INACTIVE';
document.getElementById('pid_p_value-' + widget_id).innerHTML = '0';
document.getElementById('pid_i_value-' + widget_id).innerHTML = '0';
document.getElementById('pid_d_value-' + widget_id).innerHTML = '0';
document.getElementById('pid_pid_value-' + widget_id).innerHTML = '0';
document.getElementById('duration_time-' + widget_id).innerHTML = '0';
document.getElementById('pid_p_value-' + widget_id).innerHTML = 'NONE';
document.getElementById('pid_i_value-' + widget_id).innerHTML = 'NONE';
document.getElementById('pid_d_value-' + widget_id).innerHTML = 'NONE';
document.getElementById('pid_pid_value-' + widget_id).innerHTML = 'NONE';
document.getElementById('duration_time-' + widget_id).innerHTML = 'NONE';
document.getElementById('duty_cycle-' + widget_id).innerHTML = '';
print_pid_value(data, 'actual', widget_id, decimal_places, ' ' + units);
}
Expand Down

0 comments on commit d66831a

Please sign in to comment.