Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_exchange_failures_sensor.cpp
Go to the documentation of this file.
1/// @file platform_exchange_failures_sensor.cpp
2/// @brief Diagnostic sensor exposing a device's cumulative exchange-timeout count.
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.exchange_failures";
13
16 [this](const IoDevice &dev) { this->publish_state(static_cast<float>(dev.exchange_timeout_count)); });
17}
18
20 LOG_SENSOR("", "IO-Homecontrol Exchange Failures", this);
21 ESP_LOGCONFIG(TAG, " Device ID: %s", this->device_id_.c_str());
22}
23
24} // namespace home_io_control
25} // namespace esphome
void register_companion_binding_(const std::function< void(const IoDevice &)> &publish)
Shared setup() body: subscribe to this device's updates and publish the initial state.
void setup() override
Register the device-update subscription and publish the initial cached state.
void dump_config() override
Dump sensor configuration to the log.
static constexpr const char * TAG
Diagnostic sensor exposing a device's cumulative exchange-timeout count.
Runtime state of a paired IO‑Homecontrol device.
uint16_t exchange_timeout_count
Cumulative count of outbound exchanges to this device with no valid response (see detail::record_exch...