Skip to content

Commit

Permalink
[BasicUI] Adjust slider unit handling (#1922)
Browse files Browse the repository at this point in the history
Adjust BasicUI slider unit handling.
So far, the unit was not passed on to the slider. With proposed changes
in core openhab/openhab-core#3644, unit would be
passed and needs to stripped for the slider to work properly.

Signed-off-by: Mark Herwege <[email protected]>
  • Loading branch information
mherwege authored Jun 14, 2023
1 parent f32b8a4 commit e75f001
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bundles/org.openhab.ui.basic/web-src/smarthome.js
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,6 @@
}, 200);

_t.setValuePrivate = function(value, itemState) {
// itemState contains only value in the display unit (in case unit is set in label pattern)
if (_t.hasValue) {
_t.valueNode.innerHTML = value;
}
Expand All @@ -1695,7 +1694,7 @@
if (itemState === "NULL" || itemState === "UNDEF") {
_t.input.value = 0;
} else {
_t.input.value = itemState;
_t.input.value = itemState.split(" ")[0] * 1;
}
_t.input.MaterialSlider.change();
};
Expand Down

0 comments on commit e75f001

Please sign in to comment.