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
5
#include "
platform_pairing_result_text_sensor.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.pairing_result"
;
13
14
void
IOHomePairingResultTextSensor::setup
() {
15
if
(this->
parent_
==
nullptr
)
16
return
;
17
18
this->
parent_
->set_pairing_result_callback([
this
]() { this->
on_pairing_result_
(); });
19
}
20
21
void
IOHomePairingResultTextSensor::dump_config
() { LOG_TEXT_SENSOR(
""
,
"IO-Homecontrol Last Pairing Result"
,
this
); }
22
23
void
IOHomePairingResultTextSensor::on_pairing_result_
() {
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
esphome::home_io_control::IOHomePairingResultTextSensor::parent_
IOHomeControlComponent * parent_
Definition
platform_pairing_result_text_sensor.h:41
esphome::home_io_control::IOHomePairingResultTextSensor::setup
void setup() override
Register the pairing-result callback.
Definition
platform_pairing_result_text_sensor.cpp:14
esphome::home_io_control::IOHomePairingResultTextSensor::on_pairing_result_
void on_pairing_result_()
Publish the latest pairing telemetry result string.
Definition
platform_pairing_result_text_sensor.cpp:23
esphome::home_io_control::IOHomePairingResultTextSensor::dump_config
void dump_config() override
Dump text-sensor configuration to the log.
Definition
platform_pairing_result_text_sensor.cpp:21
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_pairing_result_text_sensor.h
Diagnostic text sensor exposing the machine-readable "Last Pairing Result" string.
components
home_io_control
platform_pairing_result_text_sensor.cpp
Generated by
1.16.1