mirror of
https://github.com/esphome/esphome.git
synced 2026-10-05 18:41:32 +00:00
Implement proper API connection teardown before deep sleep/reboot (#9008)
This commit is contained in:
@@ -110,6 +110,12 @@ class Component {
|
||||
virtual void on_shutdown() {}
|
||||
virtual void on_safe_shutdown() {}
|
||||
|
||||
/** Called during teardown to allow component to gracefully finish operations.
|
||||
*
|
||||
* @return true if teardown is complete, false if more time is needed
|
||||
*/
|
||||
virtual bool teardown() { return true; }
|
||||
|
||||
uint32_t get_component_state() const;
|
||||
|
||||
/** Mark this component as failed. Any future timeouts/intervals/setup/loop will no longer be called.
|
||||
|
||||
Reference in New Issue
Block a user