diff --git a/esphome/components/api/api_outgoing_connection.h b/esphome/components/api/api_outgoing_connection.h index 16d50c34255..fff11522d79 100644 --- a/esphome/components/api/api_outgoing_connection.h +++ b/esphome/components/api/api_outgoing_connection.h @@ -59,17 +59,20 @@ class OutgoingConnectionManager { static constexpr uint32_t BACKOFF_MIN_MS = 5000; static constexpr uint32_t BACKOFF_MAX_MS = 300000; static constexpr uint32_t CONNECT_TIMEOUT_MS = 10000; - static constexpr uint32_t CONNECT_POLL_INTERVAL_MS = 250; - static constexpr uint32_t NETWORK_RETRY_MS = 500; static constexpr uint32_t PRECONDITION_RETRY_MS = 5000; // A deep sleep wake window is too short to spend on the delay, so those - // builds dial out as soon as the target is gone + // builds dial out as soon as the target is gone, recheck the network on + // every loop and notice the connect completing on the loop it does #ifdef USE_DEEP_SLEEP static constexpr uint32_t BOOT_WAIT_MS = 0; static constexpr uint32_t IDLE_WAIT_MS = BACKOFF_MIN_MS; + static constexpr uint32_t CONNECT_POLL_INTERVAL_MS = 0; + static constexpr uint32_t NETWORK_RETRY_MS = 0; #else static constexpr uint32_t BOOT_WAIT_MS = API_OUTGOING_CONNECTION_DELAY; static constexpr uint32_t IDLE_WAIT_MS = API_OUTGOING_CONNECTION_DELAY; + static constexpr uint32_t CONNECT_POLL_INTERVAL_MS = 250; + static constexpr uint32_t NETWORK_RETRY_MS = 500; #endif void try_dial_(APIServer *server, uint32_t now);