mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
[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.
This commit is contained in:
parent
8ebd17ddb2
commit
ef8db947b3
1 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue