Simplify automations

I have 4 automations to put on/off the same light. Can it in one ? these are the triggers…

in the morning

triggers:
  - trigger: sun
    event: sunrise
    offset: "-01:30:00"
conditions: []
actions:
  - action: switch.turn_on
triggers:
  - trigger: sun
    event: sunrise
    offset: "+01:30"
conditions: []
actions:
  - action: switch.turn_off

in the evening

triggers:
  - trigger: sun
    event: sunset
conditions: []
actions:
  - action: switch.turn_on
triggers:
  - trigger: time
    at: "22:30:00"
conditions: []
actions:
  - action: switch.turn_off

Define IDs for triggers, then do smth like (pseudo code)

if ID = ... or ID = ...
  turn on
else
 turn off

put the actions in a conditional script, and create one automation with all triggers calling the script

triggers:
  - trigger: sun
    event: sunrise
    offset: "-01:30:00"
    id: "on"
  - trigger: sun
    event: sunrise
    offset: "+01:30"
    id: "off"
  - trigger: sun
    event: sunset
    id: "on"
  - trigger: time
    at: "22:30:00"
    id: "off"
actions:
  - action: switch.turn_{{ trigger.id }}