7#include "esphome/core/log.h"
20 this->
subscribe_armed([
this](
bool armed) { this->publish_state(armed); });
26 this->publish_state(state);
30 static const char *
const TAG =
"home_io_control.key_extraction_switch";
31 LOG_SWITCH(
"",
"IO-Homecontrol Recover System Key (Key Extraction)",
this);
32 ESP_LOGCONFIG(
TAG,
" Status: hardware-confirmed protocol; not yet confirmed against a third-party hub");
36 static const char *
const TAG =
"home_io_control.oneway_key_switch";
37 LOG_SWITCH(
"",
"IO-Homecontrol Recover 1W Controller Key",
this);
38 ESP_LOGCONFIG(
TAG,
" Receive-only: listens for an add-controller broadcast, never transmits");
51 [[maybe_unused]]
static const char *
const TAG =
"home_io_control.pairing_result";
52 LOG_TEXT_SENSOR(
"",
"IO-Homecontrol Last Pairing Result",
this);
58 this->publish_state(this->
parent_->pairing_telemetry().result_sensor_string());
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.
IOHomeControlComponent * parent_
void dump_config() override
Dump configuration to the log.
void setup() override
Register the pairing-result callback.
void on_pairing_result_()
Publish the latest pairing telemetry result string.
void dump_config() override
Dump text-sensor configuration to the log.
void dump_config() override
Dump configuration to the log.
static constexpr const char * TAG