Bathroom Automation For light ON-OFF

Hello, Bathroom (washroom) have IR sensor, this is read bathroom door is open or close so basically IR sensor use as a binary sensor, I want any condition of IR sensor ON / OFF then light on for 2 minutes, it is I all ready done but, I want, if someone again use bathroom (washroom) in before 2 minutes pass add more 2 minutes, so basically need add time add again if some one use bathroom before 2 minutes

alias: bathroom new
  - platform: state
      - binary_sensor.bathroom_ir_sensor
    to: null
  - service: switch.turn_on
    data: {}
      entity_id: switch.bathroom_light
  - delay:
      hours: 0
      minutes: 2
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    data: {}
      entity_id: switch.bathroom_light
mode: single
condition: []

Instead of the delay, you could wait for a trigger with a 2 minute timeout. The trigger is that the sensor state changed. After that you check through the trigger variable if it was fired and depending on the condition you turn the light off or add 2 more minutes. If you want to do that multiple times you could build a loop around it instead of adding more time.

could you edit my ymal file or could you example yaml , it is grateful for me