Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_pairing_result_text_sensor.cpp
Go to the documentation of this file.
1/// @file platform_pairing_result_text_sensor.cpp
2/// @brief Diagnostic text sensor exposing the "Last Pairing Result" string.
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.pairing_result";
13
15 if (this->parent_ == nullptr)
16 return;
17
18 this->parent_->set_pairing_result_callback([this]() { this->on_pairing_result_(); });
19}
20
21void IOHomePairingResultTextSensor::dump_config() { LOG_TEXT_SENSOR("", "IO-Homecontrol Last Pairing Result", this); }
22
24 if (this->parent_ == nullptr)
25 return;
26 this->publish_state(this->parent_->pairing_telemetry().result_sensor_string());
27}
28
29} // namespace home_io_control
30} // namespace esphome
void on_pairing_result_()
Publish the latest pairing telemetry result string.
void dump_config() override
Dump text-sensor configuration to the log.
static constexpr const char * TAG
Diagnostic text sensor exposing the machine-readable "Last Pairing Result" string.