similar to the tasmota ota, reset SDK when AP settings somehow are not
set to default *and* we are in safe mode already
move both even earlier in boot, before the wifi setup happens
// Some magic to allow seamless Tasmota OTA upgrades
// - inject dummy data sequence that is expected to hold current version info
// - purge settings, since we don't want accidentaly reading something as a kv
// - sometimes we cannot boot b/c of certain SDK params, purge last 16KiB
{
// ref. `SetOption78 1` in Tasmota
// - https://tasmota.github.io/docs/Commands/#setoptions (> SetOption78 Version check on Tasmota upgrade)
// - https://github.com/esphome/esphome/blob/0e59243b83913fc724d0229514a84b6ea14717cc/esphome/core/esphal.cpp#L275-L287 (the original idea from esphome)
// - https://github.com/arendst/Tasmota/blob/217addc2bb2cf46e7633c93e87954b245cb96556/tasmota/settings.ino#L218-L262 (specific checks, which succeed when finding 0xffffffff as version)
// Some magic to allow seamless Tasmota OTA upgrades
// - inject dummy data sequence that is expected to hold current version info
// - purge settings, since we don't want accidentaly reading something as a kv
// - sometimes we cannot boot b/c of certain SDK params, purge last 16KiB
{
// ref. `SetOption78 1` in Tasmota
// - https://tasmota.github.io/docs/Commands/#setoptions (> SetOption78 Version check on Tasmota upgrade)
// - https://github.com/esphome/esphome/blob/0e59243b83913fc724d0229514a84b6ea14717cc/esphome/core/esphal.cpp#L275-L287 (the original idea from esphome)
// - https://github.com/arendst/Tasmota/blob/217addc2bb2cf46e7633c93e87954b245cb96556/tasmota/settings.ino#L218-L262 (specific checks, which succeed when finding 0xffffffff as version)