ESPHome gives makers an option to keep an ESP32 output pin’s electrical state while the device sleeps or restarts. With the component configured to restore its state, an output can stay at the same level through deep sleep and waking instead of resetting.
Contributor luar123 adds the hold_state option and tests it on ESP32, ESP32-S3 and ESP32-H2. The output still needs its state set or restored after a reset. A pin configured for both input and output can briefly change level during waking, and removing a held pin from firmware through a wireless update does not release it until a hardware reset.