Using Shelly i4 to dim wled?

Hello.

I am a newby when it comes to editing automations and scripts, so any advice is welcome.

So my objective is to use Shelly i4 to dimming my segments in wled.
This is my setup. I have the shelly i4 with a toggle switch and I have it set up with single push to turn on and off the lights in wled, but not sure how to do the dimming part. Shelly i4 has the option for long push and I like to use that to dim and brighten the lights. In the automation creation I can do dimming and brighten but dont know how to add the stop trigger in between dimming and brightening.
I have been google-in and trying what i have found but nothing has worked for me.

This is the automation that i currently have.

alias: Long Push to Brighten Brightness i4
description: ""
triggers:
  - device_id: 4a09e052f499f876878d08c7490af1e5
    domain: shelly
    type: long_push
    subtype: button4
    trigger: device
conditions:
  - condition: state
    entity_id: light.wled_tv_room
    state: "on"
actions:
  - action: light.turn_on
    metadata: {}
    data:
      transition: 5
      brightness_step_pct: 10
    target:
      entity_id: light.wled_tv_room
  - repeat:
      sequence: []
      until:
        - condition: numeric_state
          entity_id: light.wled_tv_room
          attribute: brightness
          above: 254
  - action: light.turn_on
    metadata: {}
    data:
      transition: 5
      brightness_step_pct: -10
    target:
      entity_id: light.wled_tv_room
  - repeat:
      sequence: []
      until:
        - condition: numeric_state
          entity_id: light.wled_tv_room
          attribute: brightness
          below: 2
mode: restart