|
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 | 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. | |
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 296 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.
Definition at line 299 of file proto_device_model.h.
|
inline |
Withdraw the tilt prediction; call when a decoded tilt observation supersedes it.
Definition at line 304 of file proto_device_model.h.
|
inlinenodiscard |
Definition at line 292 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.
| 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.