Change esp32 wakeup pin?

Hi there,
Is there a way to change the wake-up pin configuration based on a variable?
When the esp woke up on in 25, it shall wake up on pin 26 next time and vice versa.

I figured how to detect the wake up pin, but don’t know how to set the wake up pin for the next time.

Thanks for your help!

No, that is set in stone when the configuration is compiled and uploaded.

I found this is being used in a C++ project:

esp_sleep_enable_ext1_wakeup(GPIO_SEL_26,ESP_EXT1_WAKEUP_ANY_HIGH);

Maybe this could be used inside esphome as a lambda function?

(Source: maker-monday/mailbox.ino at b3ccd55fb1feed929cd7f00395c77285e0fbbb46 · PaesslerAG/maker-monday · GitHub)