|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
What the hub predicted ahead of confirmation, kept apart from what the device reported. More...
#include <proto_device_model.h>
Public Types | |
| enum class | Motion : uint8_t { NONE = 0 , MOVING , STOPPED } |
| Predicted movement. More... | |
Public Member Functions | |
| bool | empty () const |
| void | clear () |
| Withdraw every prediction. | |
| void | clear_position () |
| Withdraw the position prediction; call when a decoded position observation supersedes it. | |
| void | forget_replaced_movement () |
| Drop the movement a STOP replaced, once nothing can roll the STOP back any more. | |
| void | clear_tilt () |
| Withdraw the tilt prediction; call when a decoded tilt observation supersedes it. | |
Public Attributes | |
| float | target {UNKNOWN_POSITION} |
| Predicted main-position target, or UNKNOWN_POSITION. | |
| float | tilt {UNKNOWN_POSITION} |
| Predicted slat angle, or UNKNOWN_POSITION. | |
| Motion | motion {Motion::NONE} |
| Predicted movement state. | |
| bool | stop_replaced_movement {false} |
| True while a pending STOP replaced a Motion::MOVING prediction that a failed STOP should bring back (DeviceRegistry::rollback_optimistic()). | |
| float | stop_replaced_target {UNKNOWN_POSITION} |
| The replaced target; meaningful only with the flag. | |
What the hub predicted ahead of confirmation, kept apart from what the device reported.
The observed fields on IoDevice (position, target, tilt, is_stopped) mean "this is what the device last told us" and are never written by a guess. Anything the hub predicts — to give the Home Assistant UI immediate feedback across the queue-dispatch and exchange gap — lands here instead, so it can be withdrawn when the command that produced it fails (DeviceRegistry::rollback_optimistic()) without risking a real observation.
Consumers read through effective_target() / effective_tilt() / effective_is_stopped() rather than either set of fields directly.
Definition at line 278 of file proto_device_model.h.
|
strong |
Predicted movement.
NONE defers to the observed is_stopped; a bool could not express "predict stopped" (apply_optimistic_stop) distinctly from "no prediction".
| Enumerator | |
|---|---|
| NONE | No movement prediction; the observed is_stopped decides. |
| MOVING | Predicted to be travelling (a position command was issued). |
| STOPPED | Predicted to be at rest (a STOP was issued). |
Definition at line 281 of file proto_device_model.h.
|
inline |
Withdraw every prediction.
Definition at line 302 of file proto_device_model.h.
|
inline |
Withdraw the position prediction; call when a decoded position observation supersedes it.
Clears motion with target because apply_optimistic_target() sets the two together, and the replaced movement with them: an observation outranks every guess about travel.
Definition at line 306 of file proto_device_model.h.
|
inline |
Withdraw the tilt prediction; call when a decoded tilt observation supersedes it.
Definition at line 317 of file proto_device_model.h.
|
inlinenodiscard |
Definition at line 298 of file proto_device_model.h.
|
inline |
Drop the movement a STOP replaced, once nothing can roll the STOP back any more.
Definition at line 312 of file proto_device_model.h.
| Motion esphome::home_io_control::OptimisticState::motion {Motion::NONE} |
Predicted movement state.
Definition at line 289 of file proto_device_model.h.
| bool esphome::home_io_control::OptimisticState::stop_replaced_movement {false} |
True while a pending STOP replaced a Motion::MOVING prediction that a failed STOP should bring back (DeviceRegistry::rollback_optimistic()).
A failed STOP means the device keeps travelling, and a device that reports nothing mid-travel has no observation to fall back on that still carries the direction. Only set alongside Motion::STOPPED.
Definition at line 294 of file proto_device_model.h.
| float esphome::home_io_control::OptimisticState::stop_replaced_target {UNKNOWN_POSITION} |
The replaced target; meaningful only with the flag.
Definition at line 295 of file proto_device_model.h.
| float esphome::home_io_control::OptimisticState::target {UNKNOWN_POSITION} |
Predicted main-position target, or UNKNOWN_POSITION.
Definition at line 287 of file proto_device_model.h.
| float esphome::home_io_control::OptimisticState::tilt {UNKNOWN_POSITION} |
Predicted slat angle, or UNKNOWN_POSITION.
Definition at line 288 of file proto_device_model.h.