Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_pairing_result_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_pairing_result_text_sensor.h
4/// @brief Diagnostic text sensor exposing the machine-readable "Last Pairing Result" string.
5/// @ingroup hioc_platforms
6
7#include "esphome/components/text_sensor/text_sensor.h"
8#include "esphome/core/component.h"
9#include "hub_core.h"
10
11namespace esphome {
12namespace home_io_control {
13
14/// @brief Diagnostic text sensor that publishes PairingTelemetry::result_sensor_string()
15/// after every pairing attempt.
16///
17/// The published string is the frozen `v1;...` format documented on
18/// PairingTelemetry::result_sensor_string() — the Phase 2 automated-rig read-back contract.
19/// Nothing is published before the first pairing attempt of this boot.
20/// @ingroup hioc_platforms
21class IOHomePairingResultTextSensor : public text_sensor::TextSensor, public Component {
22 public:
23 /// @brief Set the parent controller component.
24 /// @param parent Pointer to the IOHomeControlComponent instance.
25 void set_parent(IOHomeControlComponent *parent) { this->parent_ = parent; }
26
27 /// @brief Register the pairing-result callback.
28 void setup() override;
29
30 /// @brief Dump text-sensor configuration to the log.
31 void dump_config() override;
32
33 /// @brief Get setup priority so the parent hub is available first.
34 /// @return setup_priority::DATA.
35 [[nodiscard]] float get_setup_priority() const override { return setup_priority::DATA; }
36
37 protected:
38 /// @brief Publish the latest pairing telemetry result string.
39 void on_pairing_result_();
40
42};
43
44} // namespace home_io_control
45} // namespace esphome
The main IO-Homecontrol component.
Definition hub_core.h:74
Diagnostic text sensor that publishes PairingTelemetry::result_sensor_string() after every pairing at...
void on_pairing_result_()
Publish the latest pairing telemetry result string.
float get_setup_priority() const override
Get setup priority so the parent hub is available first.
void dump_config() override
Dump text-sensor configuration to the log.
void set_parent(IOHomeControlComponent *parent)
Set the parent controller component.
IO-Homecontrol ESPHome component — protocol controller.