Home IO Control
ESPHome add-on for IO-Homecontrol devices
Loading...
Searching...
No Matches
esphome::home_io_control::IOHomeUnconfirmedExchangesSensor Class Reference

Diagnostic sensor that publishes a device's cumulative count of exchanges it authenticated and then never closed — see detail::record_exchange_outcome() in hub_internal.h. More...

#include <platform_companion_sensors.h>

Inheritance diagram for esphome::home_io_control::IOHomeUnconfirmedExchangesSensor:
Collaboration diagram for esphome::home_io_control::IOHomeUnconfirmedExchangesSensor:

Public Member Functions

void dump_config () override
 Dump sensor configuration to the log.
Public Member Functions inherited from esphome::home_io_control::IOHomeDeviceCounterSensor
void setup () final
 Register the device-update subscription and publish the initial cached count.
Public Member Functions inherited from esphome::home_io_control::IOHomeCompanionSensor
float get_setup_priority () const override
 Get setup priority so the parent hub is available first.
Public Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the device ID whose state this companion sensor exposes.

Protected Member Functions

uint16_t counter_value (const IoDevice &dev) const override
 Return the counter this sensor publishes.
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundCompanion
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.

Additional Inherited Members

Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_

Detailed Description

Diagnostic sensor that publishes a device's cumulative count of exchanges it authenticated and then never closed — see detail::record_exchange_outcome() in hub_internal.h.

Read it against Exchange Failures: that counter rising alone means the device is not hearing the hub, while this one rising means it hears the hub's request and then either the hub's challenge answer or the device's closing reply is lost. For a movement command this outcome is reported as success, so this sensor is the only place it shows up.

Zero is meaningful here (none yet), so this publishes on setup unconditionally.

Definition at line 136 of file platform_companion_sensors.h.

Member Function Documentation

◆ counter_value()

uint16_t esphome::home_io_control::IOHomeUnconfirmedExchangesSensor::counter_value ( const IoDevice & dev) const
inlinenodiscardoverrideprotectedvirtual

Return the counter this sensor publishes.

Parameters
devDevice record to read the count from.

Implements esphome::home_io_control::IOHomeDeviceCounterSensor.

Definition at line 143 of file platform_companion_sensors.h.

◆ dump_config()

void esphome::home_io_control::IOHomeUnconfirmedExchangesSensor::dump_config ( )
override

Dump sensor configuration to the log.

Definition at line 77 of file platform_companion_sensors.cpp.


The documentation for this class was generated from the following files: