|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Shared body for the hub-level arming switches. More...
#include <platform_hub_controls.h>
Public Member Functions | |
| void | setup () final |
| Register the armed-state callback so this entity mirrors the hub's own disarm events. | |
| float | get_setup_priority () const final |
| Get setup priority so the parent hub is available first. | |
| Public Member Functions inherited from esphome::home_io_control::HubBoundEntity | |
| void | set_parent (IOHomeControlComponent *parent) |
| Set the parent controller component. | |
Protected Member Functions | |
| void | write_state (bool state) final |
| Forward the toggle to the hub and publish the state. | |
| virtual void | arm (bool state)=0 |
| Arm or disarm this switch's listener on the hub. | |
| virtual void | subscribe_armed (std::function< void(bool)> callback)=0 |
Subscribe callback to the hub's armed-state changes for this listener. | |
Additional Inherited Members | |
| Protected Attributes inherited from esphome::home_io_control::HubBoundEntity | |
| IOHomeControlComponent * | parent_ {nullptr} |
Shared body for the hub-level arming switches.
Both arming switches (2W key extraction, 1W controller-key adoption) have the same three behaviours: forward the toggle to the hub, publish the resulting state, and mirror the hub's own disarm events (auto-off timeout, or a successful recovery) so the entity never shows "on" for a window that already closed. Only the two hub calls differ, so those are the two hooks; everything else lives here once.
Deliberately NOT one concrete class parameterized by an enum or a std::function: the two switches arm independent security-sensitive listeners, and keeping them distinct C++ types means "wire the wrong one" is a compile error rather than a codegen bug.
Definition at line 40 of file platform_hub_controls.h.
|
protectedpure virtual |
Arm or disarm this switch's listener on the hub.
Implemented in esphome::home_io_control::IOHomeAcceptForeignPairingSwitch, and esphome::home_io_control::IOHomeRecoverOneWayKeySwitch.
|
inlinenodiscardfinal |
Get setup priority so the parent hub is available first.
Definition at line 48 of file platform_hub_controls.h.
|
final |
Register the armed-state callback so this entity mirrors the hub's own disarm events.
No-op when no parent is wired (codegen always wires one before setup() runs).
Definition at line 17 of file platform_hub_controls.cpp.
|
protectedpure virtual |
Subscribe callback to the hub's armed-state changes for this listener.
Implemented in esphome::home_io_control::IOHomeAcceptForeignPairingSwitch, and esphome::home_io_control::IOHomeRecoverOneWayKeySwitch.
|
finalprotected |
Forward the toggle to the hub and publish the state.
Publishing still happens with no parent wired, so an unwired switch reads as off rather than unknown in Home Assistant.
Definition at line 23 of file platform_hub_controls.cpp.