From 8b42738618f667f95738ff4e02af02bae0dc0e47 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Mon, 3 Feb 2025 12:26:25 +0100 Subject: [PATCH] Update esphome/components/mcp4461/mcp4461.cpp Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com> --- esphome/components/mcp4461/mcp4461.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index aa26bc665b..a95ff78396 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -128,13 +128,7 @@ uint16_t Mcp4461Component::get_wiper_level(uint8_t wiper) { } if (!this->read_byte_16(reg, &buf)) { this->status_set_warning(); - if (wiper > 3) { - this->status_set_warning(); - ESP_LOGW(TAG, "Error fetching nonvolatile wiper %d value", wiper); - } else { - this->status_set_warning(); - ESP_LOGW(TAG, "Error fetching wiper %d value", wiper); - } + ESP_LOGW(TAG, "Error fetching %swiper %" PRIu8 " value", (wiper > 3) ? "nonvolatile " : "", wiper); return 0; } return buf;