The existing light_action code duplicates code for brightness > 0 and brightness == 0 handling and across the dimmer, switch and color handling. Collapsing the code will make it more readable and extensible, which will be helpful for users as light_action is meant to be customized by users.
The existing light_action code duplicates code for brightness > 0 and brightness == 0 handling and across the dimmer, switch and color handling. Collapsing the code will make it more readable and extensible, which will be helpful for users as light_action is meant to be customized by users.