Esphome neopixel effect on/off button

hi,
I’m trying to control in HA an esphome ledstrip via a button: yet I have to turn on, select the effect and turn it off always going to submenus of the light effects. but really I only want a single button to toggle the effect on and off.
in esphome I yet only able to make two separate button: one to enable the effect and one on to turn on/off the light. unfortunately If I try to set the effect in the “on” part of the on/off it doesn’t work…

- platform: template
    name: my_random_button
    on_press:
       then:
        - if:
            condition:
              light.is_off: DC_Neo
            then:
              - light.turn_on:
                  id: DC_Neo
                  brightness: 0.5
                  effect: Rainbow Effect With Custom Values

  - platform: template
    name: my_On-Off_button
    on_press:      
      then:
        - if:
            condition:
              light.is_off: DC_Neo
            then:
              - light.turn_on:
                  id: DC_Neo
                  brightness: 0.5
                  effect: Rainbow Effect With Custom Values
        - if:
            condition:
              light.is_on: DC_Neo
            then:
              - light.turn_off: DC_Neo

Also with lambda didn’t work: cannot find the command to set the brightness.
does anyone know why or how to do it? I know probably with an automation but still figuring out how to do it…

now I got a working solution, maybe overengineered, adding a binary_sensor used as a status to set and read…
so now I have two button and a sensor to just use a single button!
as usual if I try to incorporate the action of the second in the first doesn’t work…
also if can chose to not show them in the dashborad, I probably think there’s a better and simpler way, which I don’t know now…

captive_portal:

binary_sensor:
  - platform: template
    id: rainbow_status
    name: rainbow_status

button:
  - platform: template
    name: my_random_button
    id: my_random_button
    on_press:
       then:
        - if:
            condition:
              light.is_off: DC_Neo
            then:
              - light.turn_on:
                  id: DC_Neo
                  brightness: 0.5
                  effect: rainbow_x

        - binary_sensor.template.publish:
            id: rainbow_status
            state: "ON"  
            
  - platform: template
    name: my_On-Off_button
    on_press:      
      then:
        - if:
            condition:
              binary_sensor.is_on: rainbow_status
            then:
              - light.turn_off: DC_Neo
              - binary_sensor.template.publish:
                 id: rainbow_status
                 state: "OFF" 
        - if:
            condition:
              binary_sensor.is_off: rainbow_status
            then:
              - button.press: my_random_button