mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
Do not call component update on failed components (#1392)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
be70a96651
commit
37bc0b3b5a
1 changed files with 5 additions and 1 deletions
|
@ -266,7 +266,11 @@ template<typename... Ts> class UpdateComponentAction : public Action<Ts...> {
|
|||
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_;
|
||||
|
|
Loading…
Reference in a new issue