Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_device_name_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_device_name_text_sensor.h
4/// @brief Diagnostic text sensor exposing the stored IO-Homecontrol device name.
5/// @ingroup hioc_platforms
6
7#include "esphome/components/text_sensor/text_sensor.h"
8#include "esphome/core/component.h"
10
11namespace esphome {
12namespace home_io_control {
13
14/// @brief Diagnostic text sensor that publishes the cached device name.
15///
16/// Beyond the shared companion behavior it also queues one boot-time GET_NAME request so the
17/// cache gets populated without waiting for unrelated traffic.
18/// @ingroup hioc_platforms
19class IOHomeDeviceNameTextSensor : public text_sensor::TextSensor, public Component, public DeviceBoundCompanion {
20 public:
21 /// @brief Register the device-update subscription and schedule an initial name fetch.
22 void setup() override;
23
24 /// @brief Dump text-sensor configuration to the log.
25 void dump_config() override;
26
27 /// @brief Get setup priority so the parent hub is available first.
28 /// @return setup_priority::DATA.
29 [[nodiscard]] float get_setup_priority() const override { return setup_priority::DATA; }
30};
31
32} // namespace home_io_control
33} // namespace esphome
Mixin holding the hub/device binding shared by the auto-generated per-device companion diagnostic sen...
Diagnostic text sensor that publishes the cached device name.
void setup() override
Register the device-update subscription and schedule an initial name fetch.
void dump_config() override
Dump text-sensor configuration to the log.
float get_setup_priority() const override
Get setup priority so the parent hub is available first.
Shared device-binding mixins for IO-Homecontrol entity platforms.