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

Binary switch entity for IO‑Homecontrol on/off devices. More...

#include <platform_switch.h>

Inheritance diagram for esphome::home_io_control::IOHomeSwitch:
Collaboration diagram for esphome::home_io_control::IOHomeSwitch:

Public Member Functions

void setup () override
 Initialize the switch entity.
void dump_config () override
 Dump configuration to log.
float get_setup_priority () const override
 Get setup priority (DATA).
Public Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the unique IO-homecontrol device ID (from YAML).
void set_device_type (DeviceType type)
 Set the declared device type (from YAML).
void set_subtype (uint8_t subtype)
 Set the declared device subtype (from YAML).
void set_optimistic_state (bool optimistic_state)
 Enable or disable optimistic target updates for this device (from YAML).
void set_status_poll_interval (uint32_t poll_interval_ms)
 Configure bounded follow-up polling while a state change is expected.

Protected Member Functions

void write_state (bool state) override
 Write state change to the device.
void on_device_update_ (const std::string &id, const IoDevice &dev)
 Callback when device state changes (e.g., from a remote).
Protected Member Functions inherited from esphome::home_io_control::DeviceBoundEntity
void register_device_binding_ (Component *self, bool inverted, std::function< void(const std::string &, const IoDevice &)> on_update)
 Perform the shared setup() registration ritual.
bool passes_binary_update_filter_ (const std::string &id, const IoDevice &dev) const
 Shared inbound-update guard for binary endpoints.
void log_poll_interval_config_ (const char *tag) const
 Emit the shared two-branch poll-interval line for dump_config().

Additional Inherited Members

Protected Attributes inherited from esphome::home_io_control::DeviceBoundEntity
IOHomeControlComponentparent_ {nullptr}
std::string device_id_
DeviceType device_type_ {DeviceType::UNKNOWN}
uint8_t subtype_ {0}
uint32_t status_poll_interval_ms_ {0}
bool optimistic_state_ {true}

Detailed Description

Binary switch entity for IO‑Homecontrol on/off devices.

The device-binding setters, setup() registration ritual and poll-interval dump line come from DeviceBoundEntity; only the on/off command and status decoding live here.

Definition at line 29 of file platform_switch.h.

Member Function Documentation

◆ dump_config()

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

Dump configuration to log.

Definition at line 37 of file platform_switch.cpp.

Here is the call graph for this function:

◆ get_setup_priority()

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

Get setup priority (DATA).

Returns
setup_priority::DATA.

Definition at line 37 of file platform_switch.h.

◆ on_device_update_()

void esphome::home_io_control::IOHomeSwitch::on_device_update_ ( const std::string & id,
const IoDevice & dev )
protected

Callback when device state changes (e.g., from a remote).

Parameters
idDevice ID.
devUpdated IoDevice state.

Definition at line 28 of file platform_switch.cpp.

Here is the call graph for this function:

◆ setup()

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

Initialize the switch entity.

Definition at line 14 of file platform_switch.cpp.

Here is the call graph for this function:

◆ write_state()

void esphome::home_io_control::IOHomeSwitch::write_state ( bool state)
overrideprotected

Write state change to the device.

Parameters
stateDesired on/off state.

Definition at line 22 of file platform_switch.cpp.


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