Use the button to iterate over the colour wheel of the light.
- Let the colour be set with one button.
- Double tap to reset
- Single tap to toggle
Dimming script should be a good starting point.
https://community.home-assistant.io/t/finally-a-cheap-wireless-switch-that-dims-xiaomi-switch-gen1/27574