Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_active_issue_text_sensor.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_active_issue_text_sensor.h
4/// @brief Diagnostic text sensor exposing a device's currently outstanding CMD_ERROR_RESP reason.
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 symbolic name of a device's most recent
15/// CMD_ERROR_RESP result code (e.g. "LIMITATION_BY_RAIN"), letting a "nothing happened" command
16/// self-explain instead of only showing up in the log. Shared by every device-bound platform
17/// (cover, light, switch, lock) via platform_common.py's companion-sensor codegen.
18///
19/// Not a per-operation outcome — it does not get set on every command, only on an explicit
20/// CMD_ERROR_RESP. Publishes an empty string until the first one is seen, and again after any
21/// subsequent successful status/command reply clears it (see detail::clear_command_result()), so
22/// a non-empty value always means "this is still going on" rather than "this is what happened
23/// last."
24/// @ingroup hioc_platforms
25class IOHomeActiveIssueTextSensor : public text_sensor::TextSensor, public Component, public DeviceBoundCompanion {
26 public:
27 /// @brief Register the device-update subscription and publish the initial cached state.
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
38} // namespace home_io_control
39} // namespace esphome
Mixin holding the hub/device binding shared by the auto-generated per-device companion diagnostic sen...
Diagnostic text sensor that publishes the symbolic name of a device's most recent CMD_ERROR_RESP resu...
void setup() override
Register the device-update subscription and publish the initial cached state.
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.