From 12d50f9e8aa7ea9d74abc004e4f6f1988db0c01e Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Tue, 4 Feb 2025 09:50:41 +0100 Subject: [PATCH] Update mcp4461_output.h --- esphome/components/mcp4461/output/mcp4461_output.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/mcp4461/output/mcp4461_output.h b/esphome/components/mcp4461/output/mcp4461_output.h index 4ca98e2533..a32509cac1 100644 --- a/esphome/components/mcp4461/output/mcp4461_output.h +++ b/esphome/components/mcp4461/output/mcp4461_output.h @@ -18,9 +18,10 @@ class Mcp4461Wiper : public output::FloatOutput { terminal_a_(terminal_a), terminal_b_(terminal_b), terminal_w_(terminal_w) { + uint8_t wiper_idx = static_cast(wiper); // update wiper connection state - if (!enable && wiper < 4) { - parent->reg_[wiper].enabled = false; + if (!enable && wiper_idx < 4) { + parent->reg_[wiper_idx].enabled = false; parent->disable_terminal(wiper, 'h'); } if (!terminal_a && wiper < 4)