A battery-powered sensor can have Wi-Fi ready yet spend most of its waking time waiting to send a reading. ESPHome starts its first MQTT connection attempt as soon as the network is ready, instead of treating the early lack of a network like a failed attempt and waiting until five seconds after boot. MQTT is a messaging system commonly used to pass sensor readings.
Leandro’s first ESPHome contribution was tested on a BK7231N board sleeping for eight seconds between reports, with a precomputed Wi-Fi key and the message server supplied by address. Connections previously took about 5.1 seconds after boot; with the correction, seven of eight starts took about 0.8–1.5 seconds, and one took 3.5 seconds.