Script that incriments Dimmer brighness_pct value from 1 to 255?

You might want to examine this script which is designed to fade a light that doesn’t support transition. You can specify the desired brightness level and transition period and the script takes care of the rest. To be clear, I didn’t invent it, I just simplified it (and converted it from an automation to a script).


NOTE

The reason why it’s more complex than merely a simple repeat is because it can compute the appropriate number of steps, and their duration, in order to perform a fairly smooth transition from any existing brightness level to any desired brightness level.