ESPHome 2025.5.0
|
#include <application.h>
Public Member Functions | |
void | pre_setup (const std::string &name, const std::string &friendly_name, const std::string &area, const char *comment, const char *compilation_time, bool name_add_mac_suffix) |
void | set_current_component (Component *component) |
Component * | get_current_component () |
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_date (datetime::DateEntity *date) |
void | register_time (datetime::TimeEntity *time) |
void | register_datetime (datetime::DateTimeEntity *datetime) |
void | register_text (text::Text *text) |
void | register_select (select::Select *select) |
void | register_lock (lock::Lock *a_lock) |
void | register_valve (valve::Valve *valve) |
void | register_media_player (media_player::MediaPlayer *media_player) |
void | register_alarm_control_panel (alarm_control_panel::AlarmControlPanel *a_alarm_control_panel) |
void | register_event (event::Event *event) |
void | register_update (update::UpdateEntity *update) |
template<class C > | |
C * | register_component (C *c) |
Register the component in this Application instance. | |
void | setup () |
Set up all the registered components. Call this at the end of your setup() function. | |
void | loop () |
Make a loop iteration. Call this in your loop() function. | |
const std::string & | get_name () const |
Get the name of this Application set by pre_setup(). | |
const std::string & | get_friendly_name () const |
Get the friendly name of this Application set by pre_setup(). | |
const std::string & | get_area () const |
Get the area of this Application set by pre_setup(). | |
std::string | get_comment () const |
Get the comment of this Application set by pre_setup(). | |
bool | is_name_add_mac_suffix_enabled () const |
std::string | get_compilation_time () const |
uint32_t IRAM_ATTR HOT | get_loop_component_start_time () const |
Get the cached time in milliseconds from when the current component started its loop execution. | |
void | set_loop_interval (uint32_t loop_interval) |
Set the target interval with which to run the loop() calls. | |
uint32_t | get_loop_interval () const |
void | schedule_dump_config () |
void | feed_wdt (uint32_t time=0) |
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< datetime::DateEntity * > & | get_dates () |
datetime::DateEntity * | get_date_by_key (uint32_t key, bool include_internal=false) |
const std::vector< datetime::TimeEntity * > & | get_times () |
datetime::TimeEntity * | get_time_by_key (uint32_t key, bool include_internal=false) |
const std::vector< datetime::DateTimeEntity * > & | get_datetimes () |
datetime::DateTimeEntity * | get_datetime_by_key (uint32_t key, bool include_internal=false) |
const std::vector< text::Text * > & | get_texts () |
text::Text * | get_text_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) |
const std::vector< valve::Valve * > & | get_valves () |
valve::Valve * | get_valve_by_key (uint32_t key, bool include_internal=false) |
const std::vector< media_player::MediaPlayer * > & | get_media_players () |
media_player::MediaPlayer * | get_media_player_by_key (uint32_t key, bool include_internal=false) |
const std::vector< alarm_control_panel::AlarmControlPanel * > & | get_alarm_control_panels () |
alarm_control_panel::AlarmControlPanel * | get_alarm_control_panel_by_key (uint32_t key, bool include_internal=false) |
const std::vector< event::Event * > & | get_events () |
event::Event * | get_event_by_key (uint32_t key, bool include_internal=false) |
const std::vector< update::UpdateEntity * > & | get_updates () |
update::UpdateEntity * | get_update_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_ () |
Definition at line 78 of file application.h.
|
protected |
Definition at line 163 of file application.cpp.
void IRAM_ATTR HOT esphome::Application::feed_wdt | ( | uint32_t | time = 0 | ) |
Definition at line 126 of file application.cpp.
|
protected |
|
inline |
Definition at line 437 of file application.h.
|
inline |
Definition at line 434 of file application.h.
|
inline |
Definition at line 250 of file application.h.
|
inline |
Get the area of this Application set by pre_setup().
Definition at line 211 of file application.h.
|
inline |
Definition at line 254 of file application.h.
|
inline |
Definition at line 253 of file application.h.
|
inline |
Definition at line 274 of file application.h.
|
inline |
Definition at line 273 of file application.h.
|
inline |
Definition at line 334 of file application.h.
|
inline |
Definition at line 333 of file application.h.
|
inline |
Get the comment of this Application set by pre_setup().
Definition at line 214 of file application.h.
|
inline |
Definition at line 218 of file application.h.
|
inline |
Definition at line 314 of file application.h.
|
inline |
Definition at line 313 of file application.h.
|
inline |
Definition at line 101 of file application.h.
|
inline |
Definition at line 354 of file application.h.
|
inline |
Definition at line 353 of file application.h.
|
inline |
Definition at line 374 of file application.h.
|
inline |
Definition at line 373 of file application.h.
|
inline |
Definition at line 448 of file application.h.
|
inline |
Definition at line 447 of file application.h.
|
inline |
Definition at line 304 of file application.h.
|
inline |
Definition at line 303 of file application.h.
|
inline |
Get the friendly name of this Application set by pre_setup().
Definition at line 208 of file application.h.
|
inline |
Definition at line 324 of file application.h.
|
inline |
Definition at line 323 of file application.h.
|
inline |
Definition at line 404 of file application.h.
|
inline |
Definition at line 403 of file application.h.
|
inline |
Get the cached time in milliseconds from when the current component started its loop execution.
Definition at line 221 of file application.h.
|
inline |
Definition at line 238 of file application.h.
|
inline |
Definition at line 424 of file application.h.
|
inline |
Definition at line 423 of file application.h.
|
inline |
Get the name of this Application set by pre_setup().
Definition at line 205 of file application.h.
|
inline |
Definition at line 344 of file application.h.
|
inline |
Definition at line 343 of file application.h.
|
inline |
Definition at line 394 of file application.h.
|
inline |
Definition at line 393 of file application.h.
|
inline |
Definition at line 284 of file application.h.
|
inline |
Definition at line 283 of file application.h.
|
inline |
Definition at line 264 of file application.h.
|
inline |
Definition at line 263 of file application.h.
|
inline |
Definition at line 384 of file application.h.
|
inline |
Definition at line 294 of file application.h.
|
inline |
Definition at line 293 of file application.h.
|
inline |
Definition at line 383 of file application.h.
|
inline |
Definition at line 364 of file application.h.
|
inline |
Definition at line 363 of file application.h.
|
inline |
Definition at line 459 of file application.h.
|
inline |
Definition at line 458 of file application.h.
|
inline |
Definition at line 414 of file application.h.
|
inline |
Definition at line 413 of file application.h.
|
inline |
Definition at line 216 of file application.h.
void esphome::Application::loop | ( | ) |
Make a loop iteration. Call this in your loop() function.
Definition at line 70 of file application.cpp.
|
inline |
Definition at line 80 of file application.h.
void esphome::Application::reboot | ( | ) |
Definition at line 141 of file application.cpp.
|
inline |
Definition at line 178 of file application.h.
|
inline |
Definition at line 104 of file application.h.
|
inline |
Definition at line 118 of file application.h.
|
inline |
Definition at line 134 of file application.h.
|
inline |
Register the component in this Application instance.
Definition at line 192 of file application.h.
|
protected |
Definition at line 14 of file application.cpp.
|
inline |
Definition at line 130 of file application.h.
|
inline |
Definition at line 146 of file application.h.
|
inline |
Definition at line 154 of file application.h.
|
inline |
Definition at line 184 of file application.h.
|
inline |
Definition at line 126 of file application.h.
|
inline |
Definition at line 138 of file application.h.
|
inline |
Definition at line 166 of file application.h.
|
inline |
Definition at line 174 of file application.h.
|
inline |
Definition at line 142 of file application.h.
|
inline |
Definition at line 162 of file application.h.
|
inline |
Definition at line 110 of file application.h.
|
inline |
Definition at line 114 of file application.h.
|
inline |
Definition at line 158 of file application.h.
|
inline |
Definition at line 122 of file application.h.
|
inline |
Definition at line 150 of file application.h.
|
inline |
Definition at line 188 of file application.h.
|
inline |
Definition at line 170 of file application.h.
void esphome::Application::run_safe_shutdown_hooks | ( | ) |
Definition at line 154 of file application.cpp.
void esphome::Application::safe_reboot | ( | ) |
Definition at line 148 of file application.cpp.
|
inline |
Definition at line 240 of file application.h.
|
inline |
Definition at line 100 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 236 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 540 of file application.h.
|
protected |
Definition at line 555 of file application.h.
|
protected |
Definition at line 548 of file application.h.
|
protected |
Definition at line 483 of file application.h.
|
protected |
Definition at line 489 of file application.h.
|
protected |
Definition at line 507 of file application.h.
|
protected |
Definition at line 549 of file application.h.
|
protected |
Definition at line 550 of file application.h.
|
protected |
Definition at line 471 of file application.h.
|
protected |
Definition at line 479 of file application.h.
|
protected |
Definition at line 504 of file application.h.
|
protected |
Definition at line 556 of file application.h.
|
protected |
Definition at line 516 of file application.h.
|
protected |
Definition at line 522 of file application.h.
|
protected |
Definition at line 554 of file application.h.
|
protected |
Definition at line 492 of file application.h.
|
protected |
Definition at line 501 of file application.h.
|
protected |
Definition at line 547 of file application.h.
|
protected |
Definition at line 552 of file application.h.
|
protected |
Definition at line 510 of file application.h.
|
protected |
Definition at line 531 of file application.h.
|
protected |
Definition at line 557 of file application.h.
|
protected |
Definition at line 553 of file application.h.
|
protected |
Definition at line 480 of file application.h.
|
protected |
Definition at line 537 of file application.h.
|
protected |
Definition at line 546 of file application.h.
|
protected |
Definition at line 551 of file application.h.
|
protected |
Definition at line 513 of file application.h.
Scheduler esphome::Application::scheduler |
Definition at line 468 of file application.h.
|
protected |
Definition at line 525 of file application.h.
|
protected |
Definition at line 495 of file application.h.
|
protected |
Definition at line 486 of file application.h.
|
protected |
Definition at line 498 of file application.h.
|
protected |
Definition at line 528 of file application.h.
|
protected |
Definition at line 519 of file application.h.
|
protected |
Definition at line 543 of file application.h.
|
protected |
Definition at line 534 of file application.h.