From c225819684e25e8bff23d0d9049843f4de4ce418 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Fri, 25 Oct 2024 18:24:20 +0200 Subject: [PATCH] Number parameter: Allow configuring any step size/number of decimals (#2832) By setting step size to 0 in a config description parameter, one can allow any step size i.e. the user can enter as many decimals as he wants to. Signed-off-by: Florian Hotze --- .../web/src/components/config/controls/parameter-number.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue b/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue index a3c347e995..3694d41bb3 100644 --- a/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue +++ b/bundles/org.openhab.ui/web/src/components/config/controls/parameter-number.vue @@ -6,7 +6,7 @@ :floating-label="$theme.md" :min="(configDescription.options && configDescription.options.length) ? undefined : configDescription.min" :max="(configDescription.options && configDescription.options.length) ? undefined : configDescription.max" - :step="configDescription.stepsize || ((configDescription.type === 'DECIMAL') ? 0.01 : undefined)" + :step="step || ((configDescription.type === 'DECIMAL') ? 0.01 : undefined)" :value="actualValue" @input="updateValue" :required="configDescription.required" validate validate-on-blur @@ -21,6 +21,10 @@ export default { computed: { actualValue () { return (this.configDescription.type === 'DECIMAL') ? parseFloat(this.value) : parseInt(this.value) + }, + step () { + if (this.configDescription.stepsize === 0) return 'any' + return this.configDescription.stepsize } }, methods: {