Created a similar script for LED-lights for Route10 and Switch S8 (and maybe other switches too), here:
and for AP6 Pro (and maybe other APs too), here: