Fixes the stepper from making phantom commands when a value is outside of the min/max (#1462)

Signed-off-by: Dan Cunningham <dan@digitaldan.com>
pull/1470/head
Dan Cunningham 2022-08-09 10:50:01 -07:00 committed by GitHub
parent c9d912d8d8
commit 49a6000c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -16,7 +16,9 @@ export default {
computed: {
value () {
if (this.config.variable) return this.context.vars[this.config.variable]
const value = this.toStepFixed(parseFloat(this.context.store[this.config.item].state))
let value = this.toStepFixed(parseFloat(this.context.store[this.config.item].state))
if (this.config.min !== undefined) value = Math.max(value, this.config.min)
if (this.config.max !== undefined) value = Math.min(value, this.config.max)
return value
}
},