From 70b52466d1b345a2cd1c8a1b21f60711368cdd6f Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Sun, 9 Feb 2025 15:44:11 +0100 Subject: [PATCH] Update mcp4461.cpp --- esphome/components/mcp4461/mcp4461.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index c0002dc6d9..5bbed4be59 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -134,9 +134,9 @@ void Mcp4461Component::loop() { if (status_has_warning()) { this->get_status_register(); } - if (this->update_) { - uint8_t i; - for (i = 0; i < 8; i++) { + uint8_t i; + for (i = 0; i < 8; i++) { + if (this->reg_[i].update) { // set wiper i state if changed if (this->reg_[i].state != this->read_wiper_level_(i)) { this->write_wiper_level_(i, this->reg_[i].state); @@ -158,7 +158,7 @@ void Mcp4461Component::loop() { } } } - this->update_ = false; + this->reg_[i].update = false; } }