Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_accept_foreign_pairing_switch.cpp
Go to the documentation of this file.
1/// @file platform_accept_foreign_pairing_switch.cpp
2/// @brief Hub-level "Accept Foreign Pairing (Key Extraction)" switch entity.
3/// @ingroup hioc_platforms
4
6
7#include "esphome/core/log.h"
8
9namespace esphome {
10namespace home_io_control {
11
12static const char *const TAG = "home_io_control.key_extraction_switch";
13
15 if (this->parent_ == nullptr)
16 return;
17 this->parent_->set_key_extraction_armed_callback([this](bool armed) { this->publish_state(armed); });
18}
19
21 if (this->parent_ != nullptr)
22 this->parent_->set_key_extraction_armed(state);
23 this->publish_state(state);
24}
25
27 LOG_SWITCH("", "IO-Homecontrol Accept Foreign Pairing (Key Extraction)", this);
28 ESP_LOGCONFIG(TAG, " Status: hardware-confirmed protocol; not yet confirmed against a third-party hub");
29}
30
31} // namespace home_io_control
32} // namespace esphome
void write_state(bool state) override
Arm or disarm the hub's key-extraction responder.
void setup() override
Register the armed-state callback so this entity mirrors the hub's own disarm events.
static constexpr const char * TAG
Hub-level switch that arms/disarms the "Accept Foreign Pairing" (key-extraction) responder.