mirror of
https://github.com/esphome/esphome.git
synced 2025-10-05 11:23:47 +01:00
Reduce CPU overhead by allowing components to disable their loop() (#9089)
This commit is contained in:
@@ -168,6 +168,8 @@ void ESP32ImprovComponent::loop() {
|
||||
case improv::STATE_PROVISIONED: {
|
||||
this->incoming_data_.clear();
|
||||
this->set_status_indicator_state_(false);
|
||||
// Provisioning complete, no further loop execution needed
|
||||
this->disable_loop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -254,6 +256,7 @@ void ESP32ImprovComponent::start() {
|
||||
|
||||
ESP_LOGD(TAG, "Setting Improv to start");
|
||||
this->should_start_ = true;
|
||||
this->enable_loop();
|
||||
}
|
||||
|
||||
void ESP32ImprovComponent::stop() {
|
||||
|
Reference in New Issue
Block a user