mirror of
https://github.com/esphome/esphome.git
synced 2026-10-19 04:32:50 +00:00
[api] Poll the outgoing dial every loop on deep sleep builds (#21077)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user