Controller

API Reference

Controller

class Controller

Controllers allow an object to be notified of every component that’s added to the Application.

Subclassed by StoringController

Public Functions

ESPHOMELIB_NAMESPACE_BEGIN void Controller::register_binary_sensor(binary_sensor::BinarySensor * obj)
void register_fan(fan::FanState *obj)
void register_light(light::LightState *obj)
void register_sensor(sensor::Sensor *obj)
void register_switch(switch_::Switch *obj)
void register_cover(cover::Cover *cover)
void register_text_sensor(text_sensor::TextSensor *obj)

StoringController

class StoringController : public Controller

A StoringController is a controller that automatically stores all components internally in vectors.

Subclassed by WebServer

Public Functions

void register_binary_sensor(binary_sensor::BinarySensor *obj)
void register_fan(fan::FanState *obj)
void register_light(light::LightState *obj)
void register_sensor(sensor::Sensor *obj)
void register_switch(switch_::Switch *obj)
void register_cover(cover::Cover *cover)
void register_text_sensor(text_sensor::TextSensor *obj)

Protected Attributes

std::vector<binary_sensor::BinarySensor *> binary_sensors_
std::vector<fan::FanState *> fans_
std::vector<light::LightState *> lights_
std::vector<sensor::Sensor *> sensors_
std::vector<switch_::Switch *> switches_
std::vector<cover::Cover *> covers_
std::vector<text_sensor::TextSensor *> text_sensors_