Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
platform_exchange_failures_sensor.h
Go to the documentation of this file.
1#pragma once
2
3/// @file platform_exchange_failures_sensor.h
4/// @brief Diagnostic sensor exposing a device's cumulative exchange-timeout count.
5/// @ingroup hioc_platforms
6
7#include "esphome/components/sensor/sensor.h"
8#include "esphome/core/component.h"
10
11namespace esphome {
12namespace home_io_control {
13
14/// @brief Diagnostic sensor that publishes a device's cumulative count of outbound exchanges
15/// that timed out (no valid response) — see detail::record_exchange_timeout() in
16/// hub_internal.h.
17///
18/// Unlike the RSSI and Last Contact sensors, zero is a meaningful value here (no failures yet),
19/// so this publishes on setup unconditionally.
20/// @ingroup hioc_platforms
21class IOHomeExchangeFailuresSensor : public sensor::Sensor, public Component, public DeviceBoundCompanion {
22 public:
23 /// @brief Register the device-update subscription and publish the initial cached state.
24 void setup() override;
25
26 /// @brief Dump sensor configuration to the log.
27 void dump_config() override;
28
29 /// @brief Get setup priority so the parent hub is available first.
30 /// @return setup_priority::DATA.
31 [[nodiscard]] float get_setup_priority() const override { return setup_priority::DATA; }
32};
33
34} // namespace home_io_control
35} // namespace esphome
Mixin holding the hub/device binding shared by the auto-generated per-device companion diagnostic sen...
Diagnostic sensor that publishes a device's cumulative count of outbound exchanges that timed out (no...
float get_setup_priority() const override
Get setup priority so the parent hub is available first.
void setup() override
Register the device-update subscription and publish the initial cached state.
void dump_config() override
Dump sensor configuration to the log.
Shared device-binding mixins for IO-Homecontrol entity platforms.