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
5
#include "
platform_accept_foreign_pairing_switch.h
"
6
7
#include "esphome/core/log.h"
8
9
namespace
esphome
{
10
namespace
home_io_control
{
11
12
static
const
char
*
const
TAG
=
"home_io_control.key_extraction_switch"
;
13
14
void
IOHomeAcceptForeignPairingSwitch::setup
() {
15
if
(this->
parent_
==
nullptr
)
16
return
;
17
this->
parent_
->set_key_extraction_armed_callback([
this
](
bool
armed) { this->publish_state(armed); });
18
}
19
20
void
IOHomeAcceptForeignPairingSwitch::write_state
(
bool
state) {
21
if
(this->
parent_
!=
nullptr
)
22
this->
parent_
->set_key_extraction_armed(state);
23
this->publish_state(state);
24
}
25
26
void
IOHomeAcceptForeignPairingSwitch::dump_config
() {
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
esphome::home_io_control::IOHomeAcceptForeignPairingSwitch::parent_
IOHomeControlComponent * parent_
Definition
platform_accept_foreign_pairing_switch.h:51
esphome::home_io_control::IOHomeAcceptForeignPairingSwitch::write_state
void write_state(bool state) override
Arm or disarm the hub's key-extraction responder.
Definition
platform_accept_foreign_pairing_switch.cpp:20
esphome::home_io_control::IOHomeAcceptForeignPairingSwitch::setup
void setup() override
Register the armed-state callback so this entity mirrors the hub's own disarm events.
Definition
platform_accept_foreign_pairing_switch.cpp:14
esphome::home_io_control::IOHomeAcceptForeignPairingSwitch::dump_config
void dump_config() override
Dump configuration to the log.
Definition
platform_accept_foreign_pairing_switch.cpp:26
esphome::home_io_control
Definition
device_registry.cpp:13
esphome::home_io_control::TAG
static constexpr const char * TAG
Definition
device_registry.cpp:15
esphome
Definition
device_registry.cpp:12
platform_accept_foreign_pairing_switch.h
Hub-level switch that arms/disarms the "Accept Foreign Pairing" (key-extraction) responder.
components
home_io_control
platform_accept_foreign_pairing_switch.cpp
Generated by
1.16.1