Hi,
I have created my own widget. Reduced to the essentials: With 2 buttons I control a dimmer. Plus button for +10%, minus button for -10%. The item takes the value as expected 0+10=10… 90+10=100. More is not possible (value range of the dimmer 0-100%). Backwards it works only up to 10%: 10-10 should be 0. However, the operation is not executed, the value remains at 10%. I don’t quite understand why, I calculate with integers, so it can’t be a rounding error (that the value falls below 0 during the calculation, which would be outside the value range for a dimmer).
- component: f7-col
config:
class:
- text-align-center
style:
width: 44px
slots:
default:
- component: oh-button
config:
action: command
actionCommand: =Number(items[props.setStufe].state) + 10
actionItem: =props.setStufe
slots:
default:
- component: f7-icon
config:
f7: plus_circle
style:
color: green
- component: Label
config:
text: =Number.parseFloat(items[props.setStufe].state) + "%"
- component: oh-button
config:
action: command
actionCommand: =Number(items[props.setStufe].state) - 10
actionItem: =props.setStufe
slots:
default:
- component: f7-icon
config:
f7: minus_circle
style:
color: green
Regards