ESPHome 2025.5.0
Loading...
Searching...
No Matches
application.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
7#include "esphome/core/hal.h"
11
12#ifdef USE_BINARY_SENSOR
14#endif
15#ifdef USE_SENSOR
17#endif
18#ifdef USE_SWITCH
20#endif
21#ifdef USE_BUTTON
23#endif
24#ifdef USE_TEXT_SENSOR
26#endif
27#ifdef USE_FAN
29#endif
30#ifdef USE_CLIMATE
32#endif
33#ifdef USE_LIGHT
35#endif
36#ifdef USE_COVER
38#endif
39#ifdef USE_NUMBER
41#endif
42#ifdef USE_DATETIME_DATE
44#endif
45#ifdef USE_DATETIME_TIME
47#endif
48#ifdef USE_DATETIME_DATETIME
50#endif
51#ifdef USE_TEXT
53#endif
54#ifdef USE_SELECT
56#endif
57#ifdef USE_LOCK
59#endif
60#ifdef USE_VALVE
62#endif
63#ifdef USE_MEDIA_PLAYER
65#endif
66#ifdef USE_ALARM_CONTROL_PANEL
68#endif
69#ifdef USE_EVENT
71#endif
72#ifdef USE_UPDATE
74#endif
75
76namespace esphome {
77
79 public:
80 void pre_setup(const std::string &name, const std::string &friendly_name, const std::string &area,
81 const char *comment, const char *compilation_time, bool name_add_mac_suffix) {
82 arch_init();
83 this->name_add_mac_suffix_ = name_add_mac_suffix;
84 if (name_add_mac_suffix) {
85 this->name_ = name + "-" + get_mac_address().substr(6);
86 if (friendly_name.empty()) {
87 this->friendly_name_ = "";
88 } else {
89 this->friendly_name_ = friendly_name + " " + get_mac_address().substr(6);
90 }
91 } else {
92 this->name_ = name;
93 this->friendly_name_ = friendly_name;
94 }
95 this->area_ = area;
96 this->comment_ = comment;
97 this->compilation_time_ = compilation_time;
98 }
99
100 void set_current_component(Component *component) { this->current_component_ = component; }
102
103#ifdef USE_BINARY_SENSOR
105 this->binary_sensors_.push_back(binary_sensor);
106 }
107#endif
108
109#ifdef USE_SENSOR
110 void register_sensor(sensor::Sensor *sensor) { this->sensors_.push_back(sensor); }
111#endif
112
113#ifdef USE_SWITCH
114 void register_switch(switch_::Switch *a_switch) { this->switches_.push_back(a_switch); }
115#endif
116
117#ifdef USE_BUTTON
118 void register_button(button::Button *button) { this->buttons_.push_back(button); }
119#endif
120
121#ifdef USE_TEXT_SENSOR
122 void register_text_sensor(text_sensor::TextSensor *sensor) { this->text_sensors_.push_back(sensor); }
123#endif
124
125#ifdef USE_FAN
126 void register_fan(fan::Fan *state) { this->fans_.push_back(state); }
127#endif
128
129#ifdef USE_COVER
130 void register_cover(cover::Cover *cover) { this->covers_.push_back(cover); }
131#endif
132
133#ifdef USE_CLIMATE
134 void register_climate(climate::Climate *climate) { this->climates_.push_back(climate); }
135#endif
136
137#ifdef USE_LIGHT
138 void register_light(light::LightState *light) { this->lights_.push_back(light); }
139#endif
140
141#ifdef USE_NUMBER
142 void register_number(number::Number *number) { this->numbers_.push_back(number); }
143#endif
144
145#ifdef USE_DATETIME_DATE
146 void register_date(datetime::DateEntity *date) { this->dates_.push_back(date); }
147#endif
148
149#ifdef USE_DATETIME_TIME
150 void register_time(datetime::TimeEntity *time) { this->times_.push_back(time); }
151#endif
152
153#ifdef USE_DATETIME_DATETIME
154 void register_datetime(datetime::DateTimeEntity *datetime) { this->datetimes_.push_back(datetime); }
155#endif
156
157#ifdef USE_TEXT
158 void register_text(text::Text *text) { this->texts_.push_back(text); }
159#endif
160
161#ifdef USE_SELECT
162 void register_select(select::Select *select) { this->selects_.push_back(select); }
163#endif
164
165#ifdef USE_LOCK
166 void register_lock(lock::Lock *a_lock) { this->locks_.push_back(a_lock); }
167#endif
168
169#ifdef USE_VALVE
170 void register_valve(valve::Valve *valve) { this->valves_.push_back(valve); }
171#endif
172
173#ifdef USE_MEDIA_PLAYER
174 void register_media_player(media_player::MediaPlayer *media_player) { this->media_players_.push_back(media_player); }
175#endif
176
177#ifdef USE_ALARM_CONTROL_PANEL
179 this->alarm_control_panels_.push_back(a_alarm_control_panel);
180 }
181#endif
182
183#ifdef USE_EVENT
184 void register_event(event::Event *event) { this->events_.push_back(event); }
185#endif
186
187#ifdef USE_UPDATE
188 void register_update(update::UpdateEntity *update) { this->updates_.push_back(update); }
189#endif
190
192 template<class C> C *register_component(C *c) {
193 static_assert(std::is_base_of<Component, C>::value, "Only Component subclasses can be registered");
194 this->register_component_((Component *) c);
195 return c;
196 }
197
199 void setup();
200
202 void loop();
203
205 const std::string &get_name() const { return this->name_; }
206
208 const std::string &get_friendly_name() const { return this->friendly_name_; }
209
211 const std::string &get_area() const { return this->area_; }
212
214 std::string get_comment() const { return this->comment_; }
215
217
218 std::string get_compilation_time() const { return this->compilation_time_; }
219
221 inline uint32_t IRAM_ATTR HOT get_loop_component_start_time() const { return this->loop_component_start_time_; }
222
236 void set_loop_interval(uint32_t loop_interval) { this->loop_interval_ = loop_interval; }
237
238 uint32_t get_loop_interval() const { return this->loop_interval_; }
239
241
242 void feed_wdt(uint32_t time = 0);
243
244 void reboot();
245
246 void safe_reboot();
247
249
250 uint32_t get_app_state() const { return this->app_state_; }
251
252#ifdef USE_BINARY_SENSOR
253 const std::vector<binary_sensor::BinarySensor *> &get_binary_sensors() { return this->binary_sensors_; }
254 binary_sensor::BinarySensor *get_binary_sensor_by_key(uint32_t key, bool include_internal = false) {
255 for (auto *obj : this->binary_sensors_) {
256 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
257 return obj;
258 }
259 return nullptr;
260 }
261#endif
262#ifdef USE_SWITCH
263 const std::vector<switch_::Switch *> &get_switches() { return this->switches_; }
264 switch_::Switch *get_switch_by_key(uint32_t key, bool include_internal = false) {
265 for (auto *obj : this->switches_) {
266 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
267 return obj;
268 }
269 return nullptr;
270 }
271#endif
272#ifdef USE_BUTTON
273 const std::vector<button::Button *> &get_buttons() { return this->buttons_; }
274 button::Button *get_button_by_key(uint32_t key, bool include_internal = false) {
275 for (auto *obj : this->buttons_) {
276 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
277 return obj;
278 }
279 return nullptr;
280 }
281#endif
282#ifdef USE_SENSOR
283 const std::vector<sensor::Sensor *> &get_sensors() { return this->sensors_; }
284 sensor::Sensor *get_sensor_by_key(uint32_t key, bool include_internal = false) {
285 for (auto *obj : this->sensors_) {
286 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
287 return obj;
288 }
289 return nullptr;
290 }
291#endif
292#ifdef USE_TEXT_SENSOR
293 const std::vector<text_sensor::TextSensor *> &get_text_sensors() { return this->text_sensors_; }
294 text_sensor::TextSensor *get_text_sensor_by_key(uint32_t key, bool include_internal = false) {
295 for (auto *obj : this->text_sensors_) {
296 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
297 return obj;
298 }
299 return nullptr;
300 }
301#endif
302#ifdef USE_FAN
303 const std::vector<fan::Fan *> &get_fans() { return this->fans_; }
304 fan::Fan *get_fan_by_key(uint32_t key, bool include_internal = false) {
305 for (auto *obj : this->fans_) {
306 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
307 return obj;
308 }
309 return nullptr;
310 }
311#endif
312#ifdef USE_COVER
313 const std::vector<cover::Cover *> &get_covers() { return this->covers_; }
314 cover::Cover *get_cover_by_key(uint32_t key, bool include_internal = false) {
315 for (auto *obj : this->covers_) {
316 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
317 return obj;
318 }
319 return nullptr;
320 }
321#endif
322#ifdef USE_LIGHT
323 const std::vector<light::LightState *> &get_lights() { return this->lights_; }
324 light::LightState *get_light_by_key(uint32_t key, bool include_internal = false) {
325 for (auto *obj : this->lights_) {
326 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
327 return obj;
328 }
329 return nullptr;
330 }
331#endif
332#ifdef USE_CLIMATE
333 const std::vector<climate::Climate *> &get_climates() { return this->climates_; }
334 climate::Climate *get_climate_by_key(uint32_t key, bool include_internal = false) {
335 for (auto *obj : this->climates_) {
336 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
337 return obj;
338 }
339 return nullptr;
340 }
341#endif
342#ifdef USE_NUMBER
343 const std::vector<number::Number *> &get_numbers() { return this->numbers_; }
344 number::Number *get_number_by_key(uint32_t key, bool include_internal = false) {
345 for (auto *obj : this->numbers_) {
346 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
347 return obj;
348 }
349 return nullptr;
350 }
351#endif
352#ifdef USE_DATETIME_DATE
353 const std::vector<datetime::DateEntity *> &get_dates() { return this->dates_; }
354 datetime::DateEntity *get_date_by_key(uint32_t key, bool include_internal = false) {
355 for (auto *obj : this->dates_) {
356 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
357 return obj;
358 }
359 return nullptr;
360 }
361#endif
362#ifdef USE_DATETIME_TIME
363 const std::vector<datetime::TimeEntity *> &get_times() { return this->times_; }
364 datetime::TimeEntity *get_time_by_key(uint32_t key, bool include_internal = false) {
365 for (auto *obj : this->times_) {
366 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
367 return obj;
368 }
369 return nullptr;
370 }
371#endif
372#ifdef USE_DATETIME_DATETIME
373 const std::vector<datetime::DateTimeEntity *> &get_datetimes() { return this->datetimes_; }
374 datetime::DateTimeEntity *get_datetime_by_key(uint32_t key, bool include_internal = false) {
375 for (auto *obj : this->datetimes_) {
376 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
377 return obj;
378 }
379 return nullptr;
380 }
381#endif
382#ifdef USE_TEXT
383 const std::vector<text::Text *> &get_texts() { return this->texts_; }
384 text::Text *get_text_by_key(uint32_t key, bool include_internal = false) {
385 for (auto *obj : this->texts_) {
386 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
387 return obj;
388 }
389 return nullptr;
390 }
391#endif
392#ifdef USE_SELECT
393 const std::vector<select::Select *> &get_selects() { return this->selects_; }
394 select::Select *get_select_by_key(uint32_t key, bool include_internal = false) {
395 for (auto *obj : this->selects_) {
396 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
397 return obj;
398 }
399 return nullptr;
400 }
401#endif
402#ifdef USE_LOCK
403 const std::vector<lock::Lock *> &get_locks() { return this->locks_; }
404 lock::Lock *get_lock_by_key(uint32_t key, bool include_internal = false) {
405 for (auto *obj : this->locks_) {
406 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
407 return obj;
408 }
409 return nullptr;
410 }
411#endif
412#ifdef USE_VALVE
413 const std::vector<valve::Valve *> &get_valves() { return this->valves_; }
414 valve::Valve *get_valve_by_key(uint32_t key, bool include_internal = false) {
415 for (auto *obj : this->valves_) {
416 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
417 return obj;
418 }
419 return nullptr;
420 }
421#endif
422#ifdef USE_MEDIA_PLAYER
423 const std::vector<media_player::MediaPlayer *> &get_media_players() { return this->media_players_; }
424 media_player::MediaPlayer *get_media_player_by_key(uint32_t key, bool include_internal = false) {
425 for (auto *obj : this->media_players_) {
426 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
427 return obj;
428 }
429 return nullptr;
430 }
431#endif
432
433#ifdef USE_ALARM_CONTROL_PANEL
434 const std::vector<alarm_control_panel::AlarmControlPanel *> &get_alarm_control_panels() {
435 return this->alarm_control_panels_;
436 }
437 alarm_control_panel::AlarmControlPanel *get_alarm_control_panel_by_key(uint32_t key, bool include_internal = false) {
438 for (auto *obj : this->alarm_control_panels_) {
439 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
440 return obj;
441 }
442 return nullptr;
443 }
444#endif
445
446#ifdef USE_EVENT
447 const std::vector<event::Event *> &get_events() { return this->events_; }
448 event::Event *get_event_by_key(uint32_t key, bool include_internal = false) {
449 for (auto *obj : this->events_) {
450 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
451 return obj;
452 }
453 return nullptr;
454 }
455#endif
456
457#ifdef USE_UPDATE
458 const std::vector<update::UpdateEntity *> &get_updates() { return this->updates_; }
459 update::UpdateEntity *get_update_by_key(uint32_t key, bool include_internal = false) {
460 for (auto *obj : this->updates_) {
461 if (obj->get_object_id_hash() == key && (include_internal || !obj->is_internal()))
462 return obj;
463 }
464 return nullptr;
465 }
466#endif
467
469
470 protected:
471 friend Component;
472
473 void register_component_(Component *comp);
474
476
478
479 std::vector<Component *> components_{};
480 std::vector<Component *> looping_components_{};
481
482#ifdef USE_BINARY_SENSOR
483 std::vector<binary_sensor::BinarySensor *> binary_sensors_{};
484#endif
485#ifdef USE_SWITCH
486 std::vector<switch_::Switch *> switches_{};
487#endif
488#ifdef USE_BUTTON
489 std::vector<button::Button *> buttons_{};
490#endif
491#ifdef USE_EVENT
492 std::vector<event::Event *> events_{};
493#endif
494#ifdef USE_SENSOR
495 std::vector<sensor::Sensor *> sensors_{};
496#endif
497#ifdef USE_TEXT_SENSOR
498 std::vector<text_sensor::TextSensor *> text_sensors_{};
499#endif
500#ifdef USE_FAN
501 std::vector<fan::Fan *> fans_{};
502#endif
503#ifdef USE_COVER
504 std::vector<cover::Cover *> covers_{};
505#endif
506#ifdef USE_CLIMATE
507 std::vector<climate::Climate *> climates_{};
508#endif
509#ifdef USE_LIGHT
510 std::vector<light::LightState *> lights_{};
511#endif
512#ifdef USE_NUMBER
513 std::vector<number::Number *> numbers_{};
514#endif
515#ifdef USE_DATETIME_DATE
516 std::vector<datetime::DateEntity *> dates_{};
517#endif
518#ifdef USE_DATETIME_TIME
519 std::vector<datetime::TimeEntity *> times_{};
520#endif
521#ifdef USE_DATETIME_DATETIME
522 std::vector<datetime::DateTimeEntity *> datetimes_{};
523#endif
524#ifdef USE_SELECT
525 std::vector<select::Select *> selects_{};
526#endif
527#ifdef USE_TEXT
528 std::vector<text::Text *> texts_{};
529#endif
530#ifdef USE_LOCK
531 std::vector<lock::Lock *> locks_{};
532#endif
533#ifdef USE_VALVE
534 std::vector<valve::Valve *> valves_{};
535#endif
536#ifdef USE_MEDIA_PLAYER
537 std::vector<media_player::MediaPlayer *> media_players_{};
538#endif
539#ifdef USE_ALARM_CONTROL_PANEL
540 std::vector<alarm_control_panel::AlarmControlPanel *> alarm_control_panels_{};
541#endif
542#ifdef USE_UPDATE
543 std::vector<update::UpdateEntity *> updates_{};
544#endif
545
546 std::string name_;
547 std::string friendly_name_;
548 std::string area_;
549 const char *comment_{nullptr};
550 const char *compilation_time_{nullptr};
552 uint32_t last_loop_{0};
553 uint32_t loop_interval_{16};
554 size_t dump_config_at_{SIZE_MAX};
555 uint32_t app_state_{0};
558};
559
561extern Application App; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
562
563} // namespace esphome
void setup()
Set up all the registered components. Call this at the end of your setup() function.
uint32_t get_loop_interval() const
std::string get_comment() const
Get the comment of this Application set by pre_setup().
void register_fan(fan::Fan *state)
datetime::DateEntity * get_date_by_key(uint32_t key, bool include_internal=false)
alarm_control_panel::AlarmControlPanel * get_alarm_control_panel_by_key(uint32_t key, bool include_internal=false)
void register_button(button::Button *button)
const std::string & get_area() const
Get the area of this Application set by pre_setup().
binary_sensor::BinarySensor * get_binary_sensor_by_key(uint32_t key, bool include_internal=false)
const std::string & get_friendly_name() const
Get the friendly name of this Application set by pre_setup().
const std::vector< button::Button * > & get_buttons()
void register_light(light::LightState *light)
void register_binary_sensor(binary_sensor::BinarySensor *binary_sensor)
const std::vector< datetime::TimeEntity * > & get_times()
const std::vector< valve::Valve * > & get_valves()
text::Text * get_text_by_key(uint32_t key, bool include_internal=false)
button::Button * get_button_by_key(uint32_t key, bool include_internal=false)
const std::vector< fan::Fan * > & get_fans()
void set_current_component(Component *component)
const std::vector< switch_::Switch * > & get_switches()
Component * get_current_component()
std::vector< text::Text * > texts_
void register_alarm_control_panel(alarm_control_panel::AlarmControlPanel *a_alarm_control_panel)
fan::Fan * get_fan_by_key(uint32_t key, bool include_internal=false)
sensor::Sensor * get_sensor_by_key(uint32_t key, bool include_internal=false)
std::vector< update::UpdateEntity * > updates_
void register_update(update::UpdateEntity *update)
void register_media_player(media_player::MediaPlayer *media_player)
uint32_t get_app_state() const
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)
Definition application.h:80
std::vector< media_player::MediaPlayer * > media_players_
std::vector< event::Event * > events_
void register_number(number::Number *number)
std::vector< sensor::Sensor * > sensors_
std::vector< Component * > components_
const std::vector< sensor::Sensor * > & get_sensors()
void set_loop_interval(uint32_t loop_interval)
Set the target interval with which to run the loop() calls.
const std::vector< text_sensor::TextSensor * > & get_text_sensors()
void register_climate(climate::Climate *climate)
void register_cover(cover::Cover *cover)
std::vector< text_sensor::TextSensor * > text_sensors_
const std::vector< lock::Lock * > & get_locks()
const std::vector< datetime::DateTimeEntity * > & get_datetimes()
std::string get_compilation_time() const
const std::vector< select::Select * > & get_selects()
const std::vector< text::Text * > & get_texts()
Component * current_component_
const std::vector< climate::Climate * > & get_climates()
const std::vector< light::LightState * > & get_lights()
light::LightState * get_light_by_key(uint32_t key, bool include_internal=false)
std::vector< datetime::TimeEntity * > times_
std::vector< cover::Cover * > covers_
void register_datetime(datetime::DateTimeEntity *datetime)
media_player::MediaPlayer * get_media_player_by_key(uint32_t key, bool include_internal=false)
void register_time(datetime::TimeEntity *time)
const std::vector< update::UpdateEntity * > & get_updates()
uint32_t loop_component_start_time_
climate::Climate * get_climate_by_key(uint32_t key, bool include_internal=false)
std::vector< binary_sensor::BinarySensor * > binary_sensors_
const char * comment_
bool is_name_add_mac_suffix_enabled() const
std::vector< alarm_control_panel::AlarmControlPanel * > alarm_control_panels_
std::string friendly_name_
void register_switch(switch_::Switch *a_switch)
std::vector< lock::Lock * > locks_
const std::string & get_name() const
Get the name of this Application set by pre_setup().
void register_lock(lock::Lock *a_lock)
event::Event * get_event_by_key(uint32_t key, bool include_internal=false)
std::vector< datetime::DateEntity * > dates_
lock::Lock * get_lock_by_key(uint32_t key, bool include_internal=false)
switch_::Switch * get_switch_by_key(uint32_t key, bool include_internal=false)
void register_event(event::Event *event)
void register_valve(valve::Valve *valve)
number::Number * get_number_by_key(uint32_t key, bool include_internal=false)
void register_sensor(sensor::Sensor *sensor)
datetime::TimeEntity * get_time_by_key(uint32_t key, bool include_internal=false)
std::vector< climate::Climate * > climates_
const std::vector< datetime::DateEntity * > & get_dates()
const char * compilation_time_
const std::vector< alarm_control_panel::AlarmControlPanel * > & get_alarm_control_panels()
std::vector< Component * > looping_components_
const std::vector< cover::Cover * > & get_covers()
update::UpdateEntity * get_update_by_key(uint32_t key, bool include_internal=false)
const std::vector< media_player::MediaPlayer * > & get_media_players()
datetime::DateTimeEntity * get_datetime_by_key(uint32_t key, bool include_internal=false)
void register_text_sensor(text_sensor::TextSensor *sensor)
const std::vector< binary_sensor::BinarySensor * > & get_binary_sensors()
std::vector< switch_::Switch * > switches_
valve::Valve * get_valve_by_key(uint32_t key, bool include_internal=false)
std::vector< fan::Fan * > fans_
std::vector< number::Number * > numbers_
void register_select(select::Select *select)
void feed_wdt(uint32_t time=0)
C * register_component(C *c)
Register the component in this Application instance.
text_sensor::TextSensor * get_text_sensor_by_key(uint32_t key, bool include_internal=false)
std::vector< valve::Valve * > valves_
void loop()
Make a loop iteration. Call this in your loop() function.
void register_text(text::Text *text)
std::vector< button::Button * > buttons_
std::vector< light::LightState * > lights_
select::Select * get_select_by_key(uint32_t key, bool include_internal=false)
std::vector< select::Select * > selects_
std::vector< datetime::DateTimeEntity * > datetimes_
void calculate_looping_components_()
cover::Cover * get_cover_by_key(uint32_t key, bool include_internal=false)
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.
const std::vector< event::Event * > & get_events()
const std::vector< number::Number * > & get_numbers()
void register_component_(Component *comp)
void register_date(datetime::DateEntity *date)
Base class for all binary_sensor-type classes.
Base class for all buttons.
Definition button.h:29
ClimateDevice - This is the base class for all climate integrations.
Definition climate.h:168
Base class for all cover devices.
Definition cover.h:111
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:63
Base class for all locks.
Definition lock.h:103
Base-class for all numbers.
Definition number.h:39
Base-class for all selects.
Definition select.h:31
Base-class for all sensors.
Definition sensor.h:57
Base class for all switches.
Definition switch.h:39
Base-class for all text inputs.
Definition text.h:24
Base class for all valve devices.
Definition valve.h:105
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
void arch_init()
Definition core.cpp:39
std::string get_mac_address()
Get the device MAC address as a string, in lowercase hex notation.
Definition helpers.cpp:726
Application App
Global storage of Application pointer - only one Application can exist.