Firstly, fast Pico supports pushed and released.
The other Pico supports pushed, held and released, as well as our other button drivers support pushed, held and released.
Smooth dimming with on/off using the same button number requires the latter capability set.
Additionally, the dimmer driver requires the new changeLevel capability, which has been added to most if not all of our switchLevel (dimmer) drivers.
So let's examine a functional implementation using button number one.
The pushed event in an app will simply call device.on()
The held event in the app calls device.startLevelChange("up")
The released event in the app calls device.stopLevelChange()
For a two button controller, we have button id 2, pushed for id 2 does device.off(), held does device.startLevelChange("down") and as predicted, release for 2 does device.stopLevelChange()
That's smooth dimming in a nutshell.
I obviously cant give you a primer on how to write an application, but the above describes what the app needs to do.
2 Likes