Trying to get a loop working for WiFi Tuya colored lights at an acceptable speed

I’ve been trying to get some WiFi based Tuya lights to turn on at a random color for each light.

I have the lights available via three integrations - Tuya, SmartLife and LocalTuya (rospogrigio’s fork).

I can manually control all of the lights, including setting the color via the HA interface (via each integration).

I’m avoiding the Tuya integration where I can as I have had to ask Tuya to unblock my access to the API due to too many calls.

I have the following script

  - repeat:
      for_each:
        - light.dl_bedroom_1
        - light.dl_dining_1
        - light.dl_dining_3
        - light.dl_entryway_1
        - light.dl_kitchen_1
        - light.dl_kitchen_3
        - light.dl_living_1
        - light.dl_living_3
      sequence:
        - service: light.turn_on
          data:
            hs_color:
              - "{{ range(360)|random }}"
              - 100
            brightness_pct: 100
          target:
            entity_id: " {{ repeat.item }} "

This script works with Local Tuya, but it randomly waits 4-7 seconds after activating a light some of the time. It will sometimes do 4+ lights in a row with no delay, and sometimes will delay 4 times in a row for 5 seconds each time. It occurs often enough that each time it is run there is at least 10 seconds worth of delay if not substantially more. (I’d ideally like this list to have about 15 lights in it but that would probably mean it would take 30 seconds to a minute and a half to run)

The SmartLife integration (which I’m assuming is also doing things locally and isn’t going to get my API calls blocked through overuse) turns on all the lights without any delay, but unfortunately the scripted light.turn_on command doesn’t set the color of the globe, it just turns it on to whatever the last setting was (or does nothing if the globe is already on, whether it is in a color or white mode)

Does anyone have any advice about how I can resolve this, either by eliminating the LocalTuya delay, setting the color with SmartLife, or some other method that I’m not seeing that isn’t going to get me kicked off the Tuya API again?