mirror of
https://github.com/esphome/esphome.git
synced 2025-09-14 09:12:19 +01:00
tweak
This commit is contained in:
@@ -572,6 +572,9 @@ class Application {
|
||||
|
||||
void calculate_looping_components_();
|
||||
|
||||
// These methods are called by Component::disable_loop() and Component::enable_loop()
|
||||
// Components should not call these directly - use this->disable_loop() or this->enable_loop()
|
||||
// to ensure component state is properly updated along with the loop partition
|
||||
void disable_component_loop(Component *component);
|
||||
void enable_component_loop(Component *component);
|
||||
|
||||
|
@@ -155,6 +155,9 @@ class Component {
|
||||
*
|
||||
* This is useful for components that only need to run for a certain period of time
|
||||
* or when inactive, saving CPU cycles.
|
||||
*
|
||||
* @note Components should call this->disable_loop() on themselves, not on other components.
|
||||
* This ensures the component's state is properly updated along with the loop partition.
|
||||
*/
|
||||
void disable_loop();
|
||||
|
||||
@@ -162,6 +165,9 @@ class Component {
|
||||
*
|
||||
* This is useful for components that transition between active and inactive states
|
||||
* and need to re-enable their loop() method when becoming active again.
|
||||
*
|
||||
* @note Components should call this->enable_loop() on themselves, not on other components.
|
||||
* This ensures the component's state is properly updated along with the loop partition.
|
||||
*/
|
||||
void enable_loop();
|
||||
|
||||
|
Reference in New Issue
Block a user