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

Sensor (device_class: battery, %) publishing the level a device answers its battery level poll with. More...

#include <platform_cover_controls.h>

Inheritance diagram for esphome::home_io_control::IOHomeBatteryLevelSensor:
Collaboration diagram for esphome::home_io_control::IOHomeBatteryLevelSensor:

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.
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 Attributes

std::optional< uint16_t > published_
 Last value handed to publish_state(); avoids re-publishing on every update.
bool published_once_ {false}
 True once anything (a value or "unknown") was published.
Protected Attributes inherited from esphome::home_io_control::DeviceBoundCompanion
IOHomeControlComponent * parent_ {nullptr}
std::string device_id_

Additional Inherited Members

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.

Detailed Description

Sensor (device_class: battery, %) publishing the level a device answers its battery level poll with.

Only generated when the cover declares battery_level_poll_interval:, which also schedules the poll that feeds it (a subscription to EVENT_BATTERY_LEVEL_CHANGE, ADR 0064). Independent of the battery: true entities, which read the coarse level from status replies at no radio cost.

Todo
Percent rests on one captured value (100); confirmed on one Somfy RS100 Solar io only.

Definition at line 182 of file platform_cover_controls.h.

Member Function Documentation

◆ dump_config()

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

Dump sensor configuration to the log.

Definition at line 149 of file platform_cover_controls.cpp.

◆ setup()

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

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

Definition at line 139 of file platform_cover_controls.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ published_

std::optional<uint16_t> esphome::home_io_control::IOHomeBatteryLevelSensor::published_
protected

Last value handed to publish_state(); avoids re-publishing on every update.

Definition at line 191 of file platform_cover_controls.h.

◆ published_once_

bool esphome::home_io_control::IOHomeBatteryLevelSensor::published_once_ {false}
protected

True once anything (a value or "unknown") was published.

Definition at line 192 of file platform_cover_controls.h.


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