ESP32 flash_write_interval

Hello, I’m using an ESP32 as the brains of an alarm system. I’ve created a virtual switch to switch on a relay for the siren that only activates if a maintenance key is switched off. I’m saving the state of the virtual switch with a Global bool but it looks like it writes to flash every 60s which means the state gets lost if there is a power outage. I can change this by amending the flash_write interval but have heard about the impact on the life of the ESP32. My question is, does the state of every switch, global etc. get written to the flash or is it just the ones with restore_value: true set?