|
Home IO Control
ESPHome add-on for IO-Homecontrol devices
|
Shared base for the companions that publish one cumulative uint16_t counter held on IoDevice. More...
#include <platform_companion_sensors.h>
Public Member Functions | |
| 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 | |
| virtual uint16_t | counter_value (const IoDevice &dev) const =0 |
| 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_ |
Shared base for the companions that publish one cumulative uint16_t counter held on IoDevice.
These differ only in which field they read and what they call themselves, so the binding lives here once and each subclass supplies the field through counter_value(). Zero is a meaningful reading for all of them — "none yet", not "no data" — so unlike RSSI and Last Contact they publish unconditionally on setup.
Definition at line 57 of file platform_companion_sensors.h.
|
nodiscardprotectedpure virtual |
Return the counter this sensor publishes.
| dev | Device record to read the count from. |
Implemented in esphome::home_io_control::IOHomeExchangeFailuresSensor, and esphome::home_io_control::IOHomeUnconfirmedExchangesSensor.
|
final |
Register the device-update subscription and publish the initial cached count.
Definition at line 66 of file platform_companion_sensors.cpp.