18#include "esphome/components/button/button.h"
19#include "esphome/components/switch/switch.h"
20#include "esphome/components/text_sensor/text_sensor.h"
21#include "esphome/core/component.h"
56 virtual void arm(
bool state) = 0;
74 void arm(
bool state)
override { this->
parent_->set_key_extraction_armed(state); }
76 this->
parent_->set_key_extraction_armed_callback(std::move(callback));
97 void arm(
bool state)
override { this->
parent_->set_oneway_key_adoption_armed(state); }
99 this->
parent_->set_oneway_key_adoption_armed_callback(std::move(callback));
155 void setup()
override;
Shared body for the hub-level arming switches.
float get_setup_priority() const final
Get setup priority so the parent hub is available first.
virtual void arm(bool state)=0
Arm or disarm this switch's listener on the hub.
void write_state(bool state) final
Forward the toggle to the hub and publish the state.
virtual void subscribe_armed(std::function< void(bool)> callback)=0
Subscribe callback to the hub's armed-state changes for this listener.
void setup() final
Register the armed-state callback so this entity mirrors the hub's own disarm events.
Mixin for entities bound to the hub itself rather than to one device.
IOHomeControlComponent * parent_
Hub-level switch entity: ON arms the key-extraction responder for 10 minutes, OFF disarms it immediat...
void arm(bool state) override
Arm or disarm this switch's listener on the hub.
void subscribe_armed(std::function< void(bool)> callback) override
Subscribe callback to the hub's armed-state changes for this listener.
void dump_config() override
Dump configuration to the log.
Diagnostic text sensor that publishes PairingTelemetry::result_sensor_string() after every pairing at...
void setup() override
Register the pairing-result callback.
void on_pairing_result_()
Publish the latest pairing telemetry result string.
float get_setup_priority() const override
Get setup priority so the parent hub is available first.
void dump_config() override
Dump text-sensor configuration to the log.
Hub-level switch entity: ON arms the 1W key-recovery listener, OFF disarms it immediately.
void subscribe_armed(std::function< void(bool)> callback) override
Subscribe callback to the hub's armed-state changes for this listener.
void arm(bool state) override
Arm or disarm this switch's listener on the hub.
void dump_config() override
Dump configuration to the log.
IO-Homecontrol ESPHome component — protocol controller.