ESPHome 2026.12.0-dev
Loading...
Searching...
No Matches
zigbee_entity_base_esp32.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
4#ifdef USE_ESP32
5#ifdef USE_ZIGBEE
6
7namespace esphome::zigbee {
8
9ESPHOME_LOG_TAG(TAG, "zigbee.entity_base");
10
13 return;
14 }
15 this->report_enabled = true;
17 this->force_report_ = true;
18 }
19 this->zb_->add_on_join_callback([this](bool) {
20 if (this->report_requested_) {
21 this->enable_loop();
22 }
23 });
24}
25
27 if (!this->report_enabled) {
28 return;
29 }
30 this->report_requested_ = true;
31 this->enable_loop();
32}
33
35 if (this->set_attr_requested_) {
36 this->set_attr_internal();
37 }
38
39 if (this->report_requested_ && this->zb_->is_joined()) {
40 this->report_internal(false);
41 }
42
43 if ((!this->report_requested_ || !this->zb_->is_joined()) && !this->set_attr_requested_) {
44 this->disable_loop();
45 }
46}
47
48} // namespace esphome::zigbee
49
50#endif
51#endif
void enable_loop()
Enable this component's loop.
Definition component.h:262
void disable_loop()
Disable this component's loop.
virtual void report_internal(bool has_lock)=0
Handle pending reports and clear report_requested_ when complete; leave it set to retry.
virtual void set_attr_internal()=0
Handle pending attribute writes and clear set_attr_requested_ when complete; leave it set to retry.
ESPHOME_LOG_TAG(TAG, "zigbee.time")