From b103be99e849d4d9a6ef4bfee6ec7b4e2ce38926 Mon Sep 17 00:00:00 2001 From: Alex <33379584+alexyao2015@users.noreply.github.com> Date: Tue, 4 May 2021 21:31:38 -0500 Subject: [PATCH] Do not call component update on failed components (#1392) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/core/base_automation.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esphome/core/base_automation.h b/esphome/core/base_automation.h index d2656290bc..fa49786d1d 100644 --- a/esphome/core/base_automation.h +++ b/esphome/core/base_automation.h @@ -266,7 +266,11 @@ template class UpdateComponentAction : public Action { public: UpdateComponentAction(PollingComponent *component) : component_(component) {} - void play(Ts... x) override { this->component_->update(); } + void play(Ts... x) override { + if (this->component_->is_failed()) + return; + this->component_->update(); + } protected: PollingComponent *component_;