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).
void set_parent (IOHomeControlComponent *parent)
 Set parent controller.
void set_device_id (const std::string &id)
 Set 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_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 Attributes

IOHomeControlComponentparent_ {nullptr}
std::string device_id_
DeviceType device_type_ {DeviceType::UNKNOWN}
uint8_t subtype_ {0}
uint32_t status_poll_interval_ms_ {0}

Detailed Description

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

Definition at line 21 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 42 of file platform_switch.cpp.

◆ 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 29 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 30 of file platform_switch.cpp.

◆ set_device_id()

void esphome::home_io_control::IOHomeSwitch::set_device_id ( const std::string & id)
inline

Set device ID from YAML.

Parameters
idHex string node ID.

Definition at line 36 of file platform_switch.h.

◆ set_device_type()

void esphome::home_io_control::IOHomeSwitch::set_device_type ( DeviceType type)
inline

Set the declared device type (from YAML).

Parameters
typeDevice type enum.

Definition at line 39 of file platform_switch.h.

◆ set_parent()

void esphome::home_io_control::IOHomeSwitch::set_parent ( IOHomeControlComponent * parent)
inline

Set parent controller.

Parameters
parentPointer to IOHomeControlComponent.

Definition at line 33 of file platform_switch.h.

◆ set_status_poll_interval()

void esphome::home_io_control::IOHomeSwitch::set_status_poll_interval ( uint32_t poll_interval_ms)
inline

Configure bounded follow-up polling while a state change is expected.

Parameters
poll_interval_msPoll interval in milliseconds; zero keeps the default single settle poll only.

Definition at line 45 of file platform_switch.h.

◆ set_subtype()

void esphome::home_io_control::IOHomeSwitch::set_subtype ( uint8_t subtype)
inline

Set the declared device subtype (from YAML).

Parameters
subtypeSubtype value.

Definition at line 42 of file platform_switch.h.

◆ setup()

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

Initialize the switch entity.

Definition at line 13 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 24 of file platform_switch.cpp.

Member Data Documentation

◆ device_id_

std::string esphome::home_io_control::IOHomeSwitch::device_id_
protected

Definition at line 57 of file platform_switch.h.

◆ device_type_

DeviceType esphome::home_io_control::IOHomeSwitch::device_type_ {DeviceType::UNKNOWN}
protected

Definition at line 58 of file platform_switch.h.

◆ parent_

IOHomeControlComponent* esphome::home_io_control::IOHomeSwitch::parent_ {nullptr}
protected

Definition at line 56 of file platform_switch.h.

◆ status_poll_interval_ms_

uint32_t esphome::home_io_control::IOHomeSwitch::status_poll_interval_ms_ {0}
protected

Definition at line 60 of file platform_switch.h.

◆ subtype_

uint8_t esphome::home_io_control::IOHomeSwitch::subtype_ {0}
protected

Definition at line 59 of file platform_switch.h.


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