Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::decisions::AttemptRequest Struct Reference

What a caller asks of one exchange's attempts: a plain cap on tries (today's shape), or a read kind whose plan the engine builds for the request (ExchangeEngine::plan_read()). More...

#include <hub_decisions.h>

Collaboration diagram for esphome::home_io_control::decisions::AttemptRequest:

Public Member Functions

 AttemptRequest ()=default
 AttemptRequest (uint8_t tries)
AttemptRequest with_wake_preamble_first () const
 Mark the read as aimed at the moment the receiver has just come to rest: to a low-power target every attempt sends the wake-up preamble, which a resting receiver hears, whatever the wake belief says (ADR 0077).
AttemptRequest with_state_unknown () const
 Mark a status read as made without trustworthy news of the receiver: activity the hub may have missed can have set it moving since its last report, so a recent "stopped" report does not prove it rests.
bool is_progress_look () const
 True for a look at a device that is probably still busy: one attempt, the ladder is the retry (ReadKind::PROGRESS, or a count of SCHEDULED_POLL_MAX_TRIES).

Static Public Member Functions

static AttemptRequest of_kind (ReadKind read_kind)

Public Attributes

uint8_t max_tries {EXCHANGE_RETRY_COUNT}
 Cap on attempts; ignored once kind is set.
bool planned {false}
 True: build the plan for kind instead of using a count.
ReadKind kind {ReadKind::COMMAND}
 What the read is for; only read when planned.
bool wake_preamble_first {false}
 True for the read at a moving cover's predicted end of travel (with_wake_preamble_first()).
bool state_unknown {false}
 True for a read whose evidence about the receiver may be stale (with_state_unknown()).

Detailed Description

What a caller asks of one exchange's attempts: a plain cap on tries (today's shape), or a read kind whose plan the engine builds for the request (ExchangeEngine::plan_read()).

Converts implicitly from a number of tries, so callers that only name a count are unchanged.

Definition at line 640 of file hub_decisions.h.

Constructor & Destructor Documentation

◆ AttemptRequest() [1/2]

esphome::home_io_control::decisions::AttemptRequest::AttemptRequest ( )
default

◆ AttemptRequest() [2/2]

esphome::home_io_control::decisions::AttemptRequest::AttemptRequest ( uint8_t tries)
inline
Parameters
triesCap on attempts (the max_tries form of ExchangeEngine::send_and_receive()).

Definition at line 651 of file hub_decisions.h.

Member Function Documentation

◆ is_progress_look()

bool esphome::home_io_control::decisions::AttemptRequest::is_progress_look ( ) const
inlinenodiscard

True for a look at a device that is probably still busy: one attempt, the ladder is the retry (ReadKind::PROGRESS, or a count of SCHEDULED_POLL_MAX_TRIES).

Definition at line 684 of file hub_decisions.h.

◆ of_kind()

AttemptRequest esphome::home_io_control::decisions::AttemptRequest::of_kind ( ReadKind read_kind)
inlinestaticnodiscard
Parameters
read_kindWhat the read is for.

Definition at line 654 of file hub_decisions.h.

Here is the call graph for this function:

◆ with_state_unknown()

AttemptRequest esphome::home_io_control::decisions::AttemptRequest::with_state_unknown ( ) const
inlinenodiscard

Mark a status read as made without trustworthy news of the receiver: activity the hub may have missed can have set it moving since its last report, so a recent "stopped" report does not prove it rests.

The wake belief is then UNKNOWN unless fresh moving evidence says AWAKE (wake_belief()), and a settling read leads with one short attempt before the wake-up attempts. Only a planned read (of_kind) carries it to the engine; without effect for a target that is not low-power, for a command, and wherever the belief is not applied: a fixed preamble (with_wake_preamble_first() wins) or low_power_wake_belief switched off.

Todo
Untested on hardware, like WakeBelief::UNKNOWN itself.

Definition at line 677 of file hub_decisions.h.

Here is the call graph for this function:

◆ with_wake_preamble_first()

AttemptRequest esphome::home_io_control::decisions::AttemptRequest::with_wake_preamble_first ( ) const
inlinenodiscard

Mark the read as aimed at the moment the receiver has just come to rest: to a low-power target every attempt sends the wake-up preamble, which a resting receiver hears, whatever the wake belief says (ADR 0077).

Without effect for a target that is not low-power.

Todo
Untested on hardware: needs a low-power cover that reports a remaining time.

Definition at line 664 of file hub_decisions.h.

Here is the call graph for this function:

Member Data Documentation

◆ kind

ReadKind esphome::home_io_control::decisions::AttemptRequest::kind {ReadKind::COMMAND}

What the read is for; only read when planned.

Definition at line 643 of file hub_decisions.h.

◆ max_tries

uint8_t esphome::home_io_control::decisions::AttemptRequest::max_tries {EXCHANGE_RETRY_COUNT}

Cap on attempts; ignored once kind is set.

Definition at line 641 of file hub_decisions.h.

◆ planned

bool esphome::home_io_control::decisions::AttemptRequest::planned {false}

True: build the plan for kind instead of using a count.

Definition at line 642 of file hub_decisions.h.

◆ state_unknown

bool esphome::home_io_control::decisions::AttemptRequest::state_unknown {false}

True for a read whose evidence about the receiver may be stale (with_state_unknown()).

Definition at line 647 of file hub_decisions.h.

◆ wake_preamble_first

bool esphome::home_io_control::decisions::AttemptRequest::wake_preamble_first {false}

True for the read at a moving cover's predicted end of travel (with_wake_preamble_first()).

Definition at line 645 of file hub_decisions.h.


The documentation for this struct was generated from the following file: