Two lambdas at boot with different priorities

Hello. I would like to run lambda at boot priority 900 to turn on pins that power the sensor, then another lambda at boot priority 599 to read that sensor and put esphome to sleep even before wifi is initialized. Is it possible?

Or run lambda as soon as sensor is initialized and filer value is obtained, can I do it with automation? Thanks

I’m doing this to switch on power to an I2C sensor, and then check battery charge.

  - priority: 750.0
    - output.turn_on: bme280_supply # gpio acting as power supply pin for BME280
  - priority: 260.0
    - lambda: |-
        float min_batt = 2.75;
        float vcc = ESP.getVcc() / 1024.0;  
        if (vcc < min_batt){
          ESP_LOGE("vbat", "Low Power Supply %.3fV! Sleeping to protect battery", vcc);