ESPHome
2022.5.0
|
#include <application.h>
Public Member Functions | |
void | pre_setup (const std::string &name, const char *compilation_time, bool name_add_mac_suffix) |
void | register_binary_sensor (binary_sensor::BinarySensor *binary_sensor) |
void | register_sensor (sensor::Sensor *sensor) |
void | register_switch (switch_::Switch *a_switch) |
void | register_button (button::Button *button) |
void | register_text_sensor (text_sensor::TextSensor *sensor) |
void | register_fan (fan::Fan *state) |
void | register_cover (cover::Cover *cover) |
void | register_climate (climate::Climate *climate) |
void | register_light (light::LightState *light) |
void | register_number (number::Number *number) |
void | register_select (select::Select *select) |
void | register_lock (lock::Lock *a_lock) |
template<class C > | |
C * | register_component (C *c) |
Register the component in this Application instance. More... | |
void | setup () |
Set up all the registered components. Call this at the end of your setup() function. More... | |
void | loop () |
Make a loop iteration. Call this in your loop() function. More... | |
const std::string & | get_name () const |
Get the name of this Application set by set_name(). More... | |
bool | is_name_add_mac_suffix_enabled () const |
const std::string & | get_compilation_time () const |
void | set_loop_interval (uint32_t loop_interval) |
Set the target interval with which to run the loop() calls. More... | |
void | schedule_dump_config () |
void | feed_wdt () |
void | reboot () |
void | safe_reboot () |
void | run_safe_shutdown_hooks () |
uint32_t | get_app_state () const |
const std::vector< binary_sensor::BinarySensor * > & | get_binary_sensors () |
binary_sensor::BinarySensor * | get_binary_sensor_by_key (uint32_t key, bool include_internal=false) |
const std::vector< switch_::Switch * > & | get_switches () |
switch_::Switch * | get_switch_by_key (uint32_t key, bool include_internal=false) |
const std::vector< button::Button * > & | get_buttons () |
button::Button * | get_button_by_key (uint32_t key, bool include_internal=false) |
const std::vector< sensor::Sensor * > & | get_sensors () |
sensor::Sensor * | get_sensor_by_key (uint32_t key, bool include_internal=false) |
const std::vector< text_sensor::TextSensor * > & | get_text_sensors () |
text_sensor::TextSensor * | get_text_sensor_by_key (uint32_t key, bool include_internal=false) |
const std::vector< fan::Fan * > & | get_fans () |
fan::Fan * | get_fan_by_key (uint32_t key, bool include_internal=false) |
const std::vector< cover::Cover * > & | get_covers () |
cover::Cover * | get_cover_by_key (uint32_t key, bool include_internal=false) |
const std::vector< light::LightState * > & | get_lights () |
light::LightState * | get_light_by_key (uint32_t key, bool include_internal=false) |
const std::vector< climate::Climate * > & | get_climates () |
climate::Climate * | get_climate_by_key (uint32_t key, bool include_internal=false) |
const std::vector< number::Number * > & | get_numbers () |
number::Number * | get_number_by_key (uint32_t key, bool include_internal=false) |
const std::vector< select::Select * > & | get_selects () |
select::Select * | get_select_by_key (uint32_t key, bool include_internal=false) |
const std::vector< lock::Lock * > & | get_locks () |
lock::Lock * | get_lock_by_key (uint32_t key, bool include_internal=false) |
Data Fields | |
Scheduler | scheduler |
Protected Member Functions | |
void | register_component_ (Component *comp) |
void | calculate_looping_components_ () |
void | feed_wdt_arch_ () |
Protected Attributes | |
friend | Component |
std::vector< Component * > | components_ {} |
std::vector< Component * > | looping_components_ {} |
std::vector< binary_sensor::BinarySensor * > | binary_sensors_ {} |
std::vector< switch_::Switch * > | switches_ {} |
std::vector< button::Button * > | buttons_ {} |
std::vector< sensor::Sensor * > | sensors_ {} |
std::vector< text_sensor::TextSensor * > | text_sensors_ {} |
std::vector< fan::Fan * > | fans_ {} |
std::vector< cover::Cover * > | covers_ {} |
std::vector< climate::Climate * > | climates_ {} |
std::vector< light::LightState * > | lights_ {} |
std::vector< number::Number * > | numbers_ {} |
std::vector< select::Select * > | selects_ {} |
std::vector< lock::Lock * > | locks_ {} |
std::string | name_ |
std::string | compilation_time_ |
bool | name_add_mac_suffix_ |
uint32_t | last_loop_ {0} |
uint32_t | loop_interval_ {16} |
size_t | dump_config_at_ {SIZE_MAX} |
uint32_t | app_state_ {0} |
Definition at line 51 of file application.h.
|
protected |
Definition at line 141 of file application.cpp.
void IRAM_ATTR HOT esphome::Application::feed_wdt | ( | ) |
Definition at line 113 of file application.cpp.
|
protected |
|
inline |
Definition at line 166 of file application.h.
|
inline |
Definition at line 170 of file application.h.
|
inline |
Definition at line 169 of file application.h.
|
inline |
Definition at line 188 of file application.h.
|
inline |
Definition at line 187 of file application.h.
|
inline |
Definition at line 242 of file application.h.
|
inline |
Definition at line 241 of file application.h.
|
inline |
Definition at line 132 of file application.h.
|
inline |
Definition at line 224 of file application.h.
|
inline |
Definition at line 223 of file application.h.
|
inline |
Definition at line 215 of file application.h.
|
inline |
Definition at line 214 of file application.h.
|
inline |
Definition at line 233 of file application.h.
|
inline |
Definition at line 232 of file application.h.
|
inline |
Definition at line 269 of file application.h.
|
inline |
Definition at line 268 of file application.h.
|
inline |
Get the name of this Application set by set_name().
Definition at line 128 of file application.h.
|
inline |
Definition at line 251 of file application.h.
|
inline |
Definition at line 250 of file application.h.
|
inline |
Definition at line 260 of file application.h.
|
inline |
Definition at line 259 of file application.h.
|
inline |
Definition at line 197 of file application.h.
|
inline |
Definition at line 196 of file application.h.
|
inline |
Definition at line 179 of file application.h.
|
inline |
Definition at line 178 of file application.h.
|
inline |
Definition at line 206 of file application.h.
|
inline |
Definition at line 205 of file application.h.
|
inline |
Definition at line 130 of file application.h.
void esphome::Application::loop | ( | ) |
Make a loop iteration. Call this in your loop() function.
Definition at line 66 of file application.cpp.
|
inline |
Definition at line 53 of file application.h.
void esphome::Application::reboot | ( | ) |
Definition at line 126 of file application.cpp.
|
inline |
Definition at line 65 of file application.h.
|
inline |
Definition at line 79 of file application.h.
|
inline |
Definition at line 95 of file application.h.
|
inline |
Register the component in this Application instance.
Definition at line 115 of file application.h.
|
protected |
Definition at line 14 of file application.cpp.
|
inline |
Definition at line 91 of file application.h.
|
inline |
Definition at line 87 of file application.h.
|
inline |
Definition at line 99 of file application.h.
|
inline |
Definition at line 111 of file application.h.
|
inline |
Definition at line 103 of file application.h.
|
inline |
Definition at line 107 of file application.h.
|
inline |
Definition at line 71 of file application.h.
|
inline |
Definition at line 75 of file application.h.
|
inline |
Definition at line 83 of file application.h.
|
inline |
Definition at line 157 of file application.h.
void esphome::Application::safe_reboot | ( | ) |
Definition at line 132 of file application.cpp.
|
inline |
Definition at line 149 of file application.h.
|
inline |
Set the target interval with which to run the loop() calls.
If the loop() method takes longer than the target interval, ESPHome won't sleep in loop(), but if the time spent in loop() is small than the target, ESPHome will delay at the end of the App.loop() method.
This is done to conserve power: In most use-cases, high-speed loop() calls are not required and degrade power consumption.
Each component can request a high frequency loop execution by using the HighFrequencyLoopRequester helper in helpers.h
loop_interval | The interval in milliseconds to run the core loop at. Defaults to 16 milliseconds. |
Definition at line 147 of file application.h.
void esphome::Application::setup | ( | ) |
Set up all the registered components. Call this at the end of your setup() function.
Definition at line 28 of file application.cpp.
|
protected |
Definition at line 334 of file application.h.
|
protected |
Definition at line 292 of file application.h.
|
protected |
Definition at line 298 of file application.h.
|
protected |
Definition at line 313 of file application.h.
|
protected |
Definition at line 329 of file application.h.
|
protected |
Definition at line 280 of file application.h.
|
protected |
Definition at line 288 of file application.h.
|
protected |
Definition at line 310 of file application.h.
|
protected |
Definition at line 333 of file application.h.
|
protected |
Definition at line 307 of file application.h.
|
protected |
Definition at line 331 of file application.h.
|
protected |
Definition at line 316 of file application.h.
|
protected |
Definition at line 325 of file application.h.
|
protected |
Definition at line 332 of file application.h.
|
protected |
Definition at line 289 of file application.h.
|
protected |
Definition at line 328 of file application.h.
|
protected |
Definition at line 330 of file application.h.
|
protected |
Definition at line 319 of file application.h.
Scheduler esphome::Application::scheduler |
Definition at line 277 of file application.h.
|
protected |
Definition at line 322 of file application.h.
|
protected |
Definition at line 301 of file application.h.
|
protected |
Definition at line 295 of file application.h.
|
protected |
Definition at line 304 of file application.h.