From ef8db947b3b8b102677f11d99f87272d6921926c Mon Sep 17 00:00:00 2001 From: endym Date: Sat, 28 Sep 2024 18:31:46 +0200 Subject: [PATCH] [max6921] improve the update procedure at polling interval Do display update always before "it" handling and optionally afterwards again. This avoids gaps (short blank display) after a finished action (e.g. set_text with 1s duration) and new "it" data. --- esphome/components/max6921/max6921.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/esphome/components/max6921/max6921.cpp b/esphome/components/max6921/max6921.cpp index 95151ee4ef..d925db9c47 100644 --- a/esphome/components/max6921/max6921.cpp +++ b/esphome/components/max6921/max6921.cpp @@ -59,9 +59,13 @@ void HOT MAX6921Component::write_data(uint8_t *ptr, size_t length) { } void MAX6921Component::update() { - if (this->writer_.has_value()) - (*this->writer_)(*this); + // To avoid a gap (blank display) after a finished action (e.g. set_text with 1s duration) and new "it" data, the + // the display update is always done before the "it" handling and optionally afterwards again. this->display_->update(); + if (this->writer_.has_value()) { // "it" data? + (*this->writer_)(*this); + this->display_->update(); + } } /*