ESPHome  2022.9.1
Public Member Functions | Protected Types | Protected Attributes
esphome::ComponentIterator Class Referenceabstract

#include <component_iterator.h>

Inheritance diagram for esphome::ComponentIterator:
esphome::api::InitialStateIterator esphome::api::ListEntitiesIterator esphome::web_server::ListEntitiesIterator

Public Member Functions

void begin (bool include_internal=false)
 
void advance ()
 
virtual bool on_begin ()
 
virtual bool on_binary_sensor (binary_sensor::BinarySensor *binary_sensor)=0
 
virtual bool on_cover (cover::Cover *cover)=0
 
virtual bool on_fan (fan::Fan *fan)=0
 
virtual bool on_light (light::LightState *light)=0
 
virtual bool on_sensor (sensor::Sensor *sensor)=0
 
virtual bool on_switch (switch_::Switch *a_switch)=0
 
virtual bool on_button (button::Button *button)=0
 
virtual bool on_text_sensor (text_sensor::TextSensor *text_sensor)=0
 
virtual bool on_service (api::UserServiceDescriptor *service)
 
virtual bool on_camera (esp32_camera::ESP32Camera *camera)
 
virtual bool on_climate (climate::Climate *climate)=0
 
virtual bool on_number (number::Number *number)=0
 
virtual bool on_select (select::Select *select)=0
 
virtual bool on_lock (lock::Lock *a_lock)=0
 
virtual bool on_media_player (media_player::MediaPlayer *media_player)
 
virtual bool on_end ()
 

Protected Types

enum  IteratorState {
  IteratorState::NONE = 0, IteratorState::BEGIN, IteratorState::BINARY_SENSOR, IteratorState::COVER,
  IteratorState::FAN, IteratorState::LIGHT, IteratorState::SENSOR, IteratorState::SWITCH,
  IteratorState::BUTTON, IteratorState::TEXT_SENSOR, IteratorState::SERVICE, IteratorState::CAMERA,
  IteratorState::CLIMATE, IteratorState::NUMBER, IteratorState::SELECT, IteratorState::LOCK,
  IteratorState::MEDIA_PLAYER, IteratorState::MAX
}
 

Protected Attributes

enum esphome::ComponentIterator::IteratorState NONE
 
size_t at_ {0}
 
bool include_internal_ {false}
 

Detailed Description

Definition at line 19 of file component_iterator.h.

Member Enumeration Documentation

◆ IteratorState

Enumerator
NONE 
BEGIN 
BINARY_SENSOR 
COVER 
FAN 
LIGHT 
SENSOR 
SWITCH 
BUTTON 
TEXT_SENSOR 
SERVICE 
CAMERA 
CLIMATE 
NUMBER 
SELECT 
LOCK 
MEDIA_PLAYER 
MAX 

Definition at line 72 of file component_iterator.h.

Member Function Documentation

◆ advance()

void esphome::ComponentIterator::advance ( )

Definition at line 17 of file component_iterator.cpp.

◆ begin()

void esphome::ComponentIterator::begin ( bool  include_internal = false)

Definition at line 12 of file component_iterator.cpp.

◆ on_begin()

bool esphome::ComponentIterator::on_begin ( )
virtual

Definition at line 265 of file component_iterator.cpp.

◆ on_binary_sensor()

virtual bool esphome::ComponentIterator::on_binary_sensor ( binary_sensor::BinarySensor binary_sensor)
pure virtual

◆ on_button()

virtual bool esphome::ComponentIterator::on_button ( button::Button button)
pure virtual

◆ on_camera()

bool esphome::ComponentIterator::on_camera ( esp32_camera::ESP32Camera camera)
virtual

Reimplemented in esphome::api::ListEntitiesIterator.

Definition at line 270 of file component_iterator.cpp.

◆ on_climate()

virtual bool esphome::ComponentIterator::on_climate ( climate::Climate climate)
pure virtual

◆ on_cover()

virtual bool esphome::ComponentIterator::on_cover ( cover::Cover cover)
pure virtual

◆ on_end()

bool esphome::ComponentIterator::on_end ( )
virtual

Reimplemented in esphome::api::ListEntitiesIterator.

Definition at line 264 of file component_iterator.cpp.

◆ on_fan()

virtual bool esphome::ComponentIterator::on_fan ( fan::Fan fan)
pure virtual

◆ on_light()

virtual bool esphome::ComponentIterator::on_light ( light::LightState light)
pure virtual

◆ on_lock()

virtual bool esphome::ComponentIterator::on_lock ( lock::Lock a_lock)
pure virtual

◆ on_media_player()

bool esphome::ComponentIterator::on_media_player ( media_player::MediaPlayer media_player)
virtual

◆ on_number()

virtual bool esphome::ComponentIterator::on_number ( number::Number number)
pure virtual

◆ on_select()

virtual bool esphome::ComponentIterator::on_select ( select::Select select)
pure virtual

◆ on_sensor()

virtual bool esphome::ComponentIterator::on_sensor ( sensor::Sensor sensor)
pure virtual

◆ on_service()

bool esphome::ComponentIterator::on_service ( api::UserServiceDescriptor service)
virtual

Reimplemented in esphome::api::ListEntitiesIterator.

Definition at line 267 of file component_iterator.cpp.

◆ on_switch()

virtual bool esphome::ComponentIterator::on_switch ( switch_::Switch a_switch)
pure virtual

◆ on_text_sensor()

virtual bool esphome::ComponentIterator::on_text_sensor ( text_sensor::TextSensor text_sensor)
pure virtual

Field Documentation

◆ at_

size_t esphome::ComponentIterator::at_ {0}
protected

Definition at line 122 of file component_iterator.h.

◆ include_internal_

bool esphome::ComponentIterator::include_internal_ {false}
protected

Definition at line 123 of file component_iterator.h.

◆ NONE

enum esphome::ComponentIterator::IteratorState esphome::ComponentIterator::NONE
protected

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