Skip to content

Commit

Permalink
Add Widget: Measurement (2 Values)
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Aug 18, 2024
1 parent ed16127 commit 03fc012
Show file tree
Hide file tree
Showing 3 changed files with 371 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This release changes the install directory from ~/Mycodo to /opt/Mycodo. This ne
- Add Output: GP8403 2-Channel DAC (0-10 VDC) ([#1354](https://github.com/kizniche/Mycodo/issues/1354))
- Add Output: GP8XXX (8403) 2-Channel DAC (0-10 VDC) ([#1354](https://github.com/kizniche/Mycodo/issues/1354))
- Add Output: XL9535 16-Channel On/Off IO-Expander
- Add Widget: Measurement (2 Values)
- Add API Endpoint: /notes/create to create a Note ([#1357](https://github.com/kizniche/Mycodo/issues/1357))
- Add ability to switch displaying hostname with custom text
- Add Step Line Series Type to Graph (Synchronous) Widget
Expand Down
11 changes: 1 addition & 10 deletions mycodo/widgets/widget_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

WIDGET_INFORMATION = {
'widget_name_unique': 'widget_measurement',
'widget_name': 'Measurement',
'widget_name': 'Measurement (1 Value)',
'widget_library': '',
'no_class': True,

Expand Down Expand Up @@ -325,15 +325,6 @@
if (document.getElementById('value-' + widget_id)) {
document.getElementById('value-' + widget_id).innerHTML = measurement.toFixed(decimal_places);
}
const range_exists = document.getElementById("range_" + widget_id);
if (range_exists != null) { // Update range slider value
if (document.getElementById("range_" + widget_id)) {
document.getElementById("range_" + widget_id).value = measurement.toFixed(0);
}
if (document.getElementById("range_val_" + widget_id)) {
document.getElementById("range_val_" + widget_id).innerHTML = measurement.toFixed(0);
}
}
if (document.getElementById('timestamp-' + widget_id)) {
document.getElementById('timestamp-' + widget_id).innerHTML = formattedTime;
}
Expand Down
Loading

1 comment on commit 03fc012

@kizniche
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Radical DIY Forum. There might be relevant details there:

https://forum.radicaldiy.com/t/custom-widget-for-multiple-measurements/1916/2

Please sign in to comment.