woozar / node-red-contrib-time-based-dimmer

MIT License
4 stars 4 forks source link

Incrementing not working with custom values for one-button-dimmer #9

Closed HardcoreWR closed 4 years ago

HardcoreWR commented 4 years ago

Hello,

When I use the 'one-button-dimmer' and change the default values, incrementing the dimlevel doesn't work properly. When I press my button again to decrease the dimlevel everything is working as expected. It looks as though any custom values are interpreted as string instead of integer.

image

Increasing fails: image

Decreasing is fine: image

If you need more information, let me know!

PS. Thanks for this functionality, very useful

HardcoreWR commented 4 years ago

Okay, not entirely true that decreasing works. If I set the MaxValue to a custom value, increasing and decreasing the dimlevel gets real funny.

image

Increasing:

image

Decreasing:

image

Increasing after the last time decreasing:

image

woozar commented 4 years ago

I already had this bug before with the other dimmer. It seems that different node red versions handle the type of the variables differently. I will fix it soon. P.S. You're welcome

woozar commented 4 years ago

I just published a new version 0.7.0 I added type checks and conversions before doing the math.

@HardcoreWR Please check and report if it doesn't work. (Might take up to 2 hours until the update is available in node-red)