Fix deep sleep on_shutdown hooks (#660)

Fixes https://github.com/esphome/feature-requests/issues/294
This commit is contained in:
Otto Winter 2019-07-03 16:34:03 +02:00 committed by GitHub
parent 762f1b1fc9
commit 0ef1d178d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,9 +119,13 @@ class Application {
void safe_reboot(); void safe_reboot();
void run_safe_shutdown_hooks() { void run_safe_shutdown_hooks() {
for (auto *comp : this->components_) for (auto *comp : this->components_) {
comp->on_safe_shutdown(); comp->on_safe_shutdown();
} }
for (auto *comp : this->components_) {
comp->on_shutdown();
}
}
uint32_t get_app_state() const { return this->app_state_; } uint32_t get_app_state() const { return this->app_state_; }