Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
status_poll_policy.h File Reference

Per-device poll scheduling, failure backoff, and follow-up-poll state machine. More...

#include <algorithm>
#include <cstdint>
#include <map>
#include <optional>
#include <string>
Include dependency graph for status_poll_policy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  esphome::home_io_control::PollTracking
 Per-device poll scheduling state. More...
class  esphome::home_io_control::StatusPollPolicy
 Per-hub poll scheduling and failure-backoff policy. More...

Namespaces

namespace  esphome
namespace  esphome::home_io_control

Functions

uint32_t esphome::home_io_control::settle_delay_ms (uint32_t interval_ms, uint32_t hint_delay_ms, bool cap_for_stop)
 Resolve the follow-up settle-poll delay while a device may still be moving.

Variables

static constexpr uint32_t esphome::home_io_control::MAX_TRACKED_STATUS_POLL_WINDOW_MS = 600000
 Hard stop for bounded follow-up polling after a command or remote activity.
static constexpr uint32_t esphome::home_io_control::INITIAL_STATUS_REQUEST_DELAY_MS = 5000
 Delay before the first post-boot status request from an entity.
static constexpr uint32_t esphome::home_io_control::REMOTE_ACTIVITY_STATUS_POLL_DELAY_MS = 2000
 Delay before polling after overheard remote traffic.
static constexpr uint32_t esphome::home_io_control::ONEWAY_QUIET_PERIOD_MS = 700
 Hold queued background polls back for this long after any 1W frame, so a poll the hub itself scheduled does not occupy the (half-duplex) radio while the remote is still transmitting.
static constexpr uint32_t esphome::home_io_control::ONEWAY_POLL_DEFER_CAP_MS = 5000
 Hard cap on how long sustained 1W traffic may hold a background poll back in total, measured from the start of the burst rather than the most recent frame.
static constexpr uint32_t esphome::home_io_control::DEFAULT_SETTLE_POLL_DELAY_MS = 3000
 Default follow-up settle-poll delay used while a device may still be moving, when no explicit poll interval is configured (interval_ms == 0).
static constexpr uint32_t esphome::home_io_control::STOP_SETTLE_POLL_CAP_MS = 1000
 Upper bound on the settle-poll delay after a STOP command.
Background-poll retry delays after silent failures (no reply received)
static constexpr uint32_t esphome::home_io_control::STATUS_RETRY_AFTER_FAIL_MS = 5000
 First retry after a silent failure.
static constexpr uint32_t esphome::home_io_control::STATUS_RETRY_AFTER_FAIL_STEP2_MS = 15000
 Second retry after a silent failure.
static constexpr uint32_t esphome::home_io_control::STATUS_RETRY_AFTER_FAIL_STEP3_MS = 30000
 Third retry after a silent failure.
static constexpr uint32_t esphome::home_io_control::STATUS_RETRY_AFTER_FAIL_STEP4_MS = 60000
 Fourth retry after a silent failure.
static constexpr uint32_t esphome::home_io_control::STATUS_RETRY_AFTER_FAIL_MAX_MS
 Steady-state backoff after many silent failures.
Background-poll retry delays after auth-shaped failures (0x3C challenge seen)
static constexpr uint32_t esphome::home_io_control::STATUS_AUTH_RETRY_AFTER_FAIL_MS = 30000
 First retry after a challenge-seen failure.
static constexpr uint32_t esphome::home_io_control::STATUS_AUTH_RETRY_AFTER_FAIL_STEP2_MS = 120000
 Second retry.
static constexpr uint32_t esphome::home_io_control::STATUS_AUTH_RETRY_AFTER_FAIL_MAX_MS = 300000
 Steady-state after repeated auth failures.

Detailed Description

Per-device poll scheduling, failure backoff, and follow-up-poll state machine.

Owns all per-device poll bookkeeping (intervals, deadlines, failure counters). Pure logic with injected timestamps — fully host-testable without a clock mock.

Definition in file status_poll_policy.h.