Looping light from dim to bright while holding button?

I’m doing that with AppDamon: Rotating brightness for lights triggered by events
And here’s another solution using AppDaemon: App that cycles a lights brightness between max and min while a button/switch is held down