From d73ad39aedebf0bb4941aca26e4fce789f637a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Bana=C5=9B?= Date: Thu, 21 Dec 2023 08:03:57 +0100 Subject: [PATCH] Bug: Unwanted change resistance in x9c component (#5483) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/x9c/x9c.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/components/x9c/x9c.cpp b/esphome/components/x9c/x9c.cpp index ff7777e71f..1b283a68e5 100644 --- a/esphome/components/x9c/x9c.cpp +++ b/esphome/components/x9c/x9c.cpp @@ -7,6 +7,10 @@ namespace x9c { static const char *const TAG = "x9c.output"; void X9cOutput::trim_value(int change_amount) { + if (change_amount == 0) { + return; + } + if (change_amount > 0) { // Set change direction this->ud_pin_->digital_write(true); } else {