From dbe24bd30ebedc5207faae33fca88af7364228cf Mon Sep 17 00:00:00 2001 From: endym Date: Mon, 1 Jul 2024 14:42:46 +0200 Subject: [PATCH] fixed duration handling --- esphome/components/max6921/display.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/max6921/display.cpp b/esphome/components/max6921/display.cpp index 776555e5a4..06030f6c74 100644 --- a/esphome/components/max6921/display.cpp +++ b/esphome/components/max6921/display.cpp @@ -305,6 +305,7 @@ void Display::update(void) { break; } if (this->disp_text_.effect == TEXT_EFFECT_NONE) { // effect finished? + this->duration_ms = 0; if (this->restore_update_interval_) { // yes, polling interval changed? ESP_LOGD(TAG, "Restore polling interval: %" PRIu32 "ms", this->restore_update_interval_); this->max6921_->set_update_interval(this->restore_update_interval_); @@ -318,6 +319,7 @@ void Display::update(void) { if (this->duration_ms > 0) { if ((millis() - this->duration_ms_start_) >= this->duration_ms) { ESP_LOGD(TAG, "Effect duration of %" PRIu32 "ms expired", this->duration_ms); + this->disp_text_.set_text_effect(TEXT_EFFECT_NONE); set_mode(DISP_MODE_PRINT); } }