Use Boot Reason to set startup behaivor

I’ve had some power outages lately and I’ve decided its probably best I wait for the grid to stabilize before powering up my electronics, as I’ve heard the first few cycles may not be the most stable in voltage. The thing is if I just use:

esphome:
  name: sonoff-10
  on_boot:
    then:
      - wait_until:
          condition:
            sensor.in_range:
              id: voltage
              above: 104.4
              below: 127.2
      - output.turn_on: relay

it also reboots (waiting the 5 seconds for the sensor to get it’s first reading as I have averaging set up) when I push software updates, which is… undesirable. Is there a way to check boot reason and only perfom this delay if it booted due to a power cycle and not due to a crash/ software update?