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

Binary sensor (device_class: battery) that is ON while the device reports a low battery. More...

#include <platform_cover_controls.h>

Inheritance diagram for esphome::home_io_control::IOHomeBatteryLowBinarySensor:
Collaboration diagram for esphome::home_io_control::IOHomeBatteryLowBinarySensor:

Public Member Functions

void setup () override
 Subscribe to the device's updates and publish what is already known.
void dump_config () override
 Dump sensor configuration to the log.
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

void publish_battery_ (const IoDevice &dev)
 Publish from a device record: ON for LOW_CHARGE, OFF for NORMAL/FULL, no state otherwise.
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.

Protected Attributes

bool logged_not_reported_ {false}
 The "reports no battery" INFO line was written once already.
Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_

Detailed Description

Binary sensor (device_class: battery) that is ON while the device reports a low battery.

Home Assistant's own low-battery convention, so generic battery tooling (low-battery notification blueprints, battery views) picks it up without per-entity setup. Generated with IOHomeBatteryTextSensor when the cover declares battery: true. It reads IoDevice::battery, which only status replies update: the boot poll, the settle polls after a move, and the device's own status updates. No state while the device reports no battery; the first status that shows none logs one INFO line, so a mains device with the key set explains itself.

Definition at line 125 of file platform_cover_controls.h.

Member Function Documentation

◆ dump_config()

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

Dump sensor configuration to the log.

Definition at line 112 of file platform_cover_controls.cpp.

◆ get_setup_priority()

float esphome::home_io_control::IOHomeBatteryLowBinarySensor::get_setup_priority ( ) const
inlinenodiscardoverride

Get setup priority so the parent hub is available first.

Returns
setup_priority::DATA.

Definition at line 135 of file platform_cover_controls.h.

◆ publish_battery_()

void esphome::home_io_control::IOHomeBatteryLowBinarySensor::publish_battery_ ( const IoDevice & dev)
protected

Publish from a device record: ON for LOW_CHARGE, OFF for NORMAL/FULL, no state otherwise.

Definition at line 91 of file platform_cover_controls.cpp.

◆ setup()

void esphome::home_io_control::IOHomeBatteryLowBinarySensor::setup ( )
override

Subscribe to the device's updates and publish what is already known.

Definition at line 87 of file platform_cover_controls.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ logged_not_reported_

bool esphome::home_io_control::IOHomeBatteryLowBinarySensor::logged_not_reported_ {false}
protected

The "reports no battery" INFO line was written once already.

Definition at line 141 of file platform_cover_controls.h.


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