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

Diagnostic text sensor that publishes the cached device name. More...

#include <platform_device_name_text_sensor.h>

Inheritance diagram for esphome::home_io_control::IOHomeDeviceNameTextSensor:
Collaboration diagram for esphome::home_io_control::IOHomeDeviceNameTextSensor:

Public Member Functions

void set_parent (IOHomeControlComponent *parent)
 Set the parent controller component.
void set_device_id (const std::string &id)
 Set the device ID whose cached name this sensor exposes.
void setup () override
 Register callbacks and schedule an initial name fetch.
void dump_config () override
 Dump text-sensor configuration to the log.
float get_setup_priority () const override
 Get setup priority so the parent hub is available first.

Protected Member Functions

void on_device_update_ (const std::string &id, const IoDevice &dev)
 Publish the current cached device name after a hub update.

Protected Attributes

IOHomeControlComponentparent_ {nullptr}
std::string device_id_

Detailed Description

Diagnostic text sensor that publishes the cached device name.

Definition at line 18 of file platform_device_name_text_sensor.h.

Member Function Documentation

◆ dump_config()

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

Dump text-sensor configuration to the log.

Definition at line 29 of file platform_device_name_text_sensor.cpp.

◆ get_setup_priority()

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

Get setup priority so the parent hub is available first.

Returns
setup_priority::DATA.

Definition at line 36 of file platform_device_name_text_sensor.h.

◆ on_device_update_()

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

Publish the current cached device name after a hub update.

Parameters
idDevice ID that updated.
devUpdated cached device record.

Definition at line 34 of file platform_device_name_text_sensor.cpp.

◆ set_device_id()

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

Set the device ID whose cached name this sensor exposes.

Parameters
idHexadecimal node ID string (for example "123ABC").

Definition at line 26 of file platform_device_name_text_sensor.h.

◆ set_parent()

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

Set the parent controller component.

Parameters
parentPointer to the IOHomeControlComponent instance.

Definition at line 22 of file platform_device_name_text_sensor.h.

◆ setup()

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

Register callbacks and schedule an initial name fetch.

Definition at line 15 of file platform_device_name_text_sensor.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ device_id_

std::string esphome::home_io_control::IOHomeDeviceNameTextSensor::device_id_
protected

Definition at line 45 of file platform_device_name_text_sensor.h.

◆ parent_

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

Definition at line 44 of file platform_device_name_text_sensor.h.


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