Skip to content

Commit

Permalink
2023.9.1-133: Fix for Screens re-starts and showing twice if 'force_s…
Browse files Browse the repository at this point in the history
…creen' send

Co-authored-by: chertvl <[email protected]>
  • Loading branch information
andrewjswan and chertvl committed Nov 14, 2023
1 parent 2339525 commit e4a4cc6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/ehmtxv2/EHMTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,12 @@ namespace esphome
if (force)
{
ESP_LOGD(TAG, "force_screen: found position: %d", i);
this->queue[i]->last_time = 0.0;
this->queue[i]->endtime += this->queue[i]->screen_time_;
this->next_action_time = this->get_tick();
this->queue[i]->last_time = 0.0;
if (this->queue[i]->endtime < this->next_action_time + this->queue[i]->screen_time_)
{
this->queue[i]->endtime = this->next_action_time + this->queue[i]->screen_time_;
}
ESP_LOGW(TAG, "force_screen: icon %s in mode %d", icon_name.c_str(), mode);
}
}
Expand Down Expand Up @@ -839,7 +842,7 @@ namespace esphome
if (this->clock->now().is_valid())
{
std::string infotext;
float ts = this->get_tick();
float ts = this->get_tick() + static_cast<float>(EHMTXv2_SCROLL_INTERVALL); // Force remove expired queue element

for (size_t i = 0; i < MAXQUEUE; i++)
{
Expand Down

0 comments on commit e4a4cc6

Please sign in to comment.