Skip to content

Commit

Permalink
Merge pull request #148 from andrewjswan/2023.9.1-133-Fix_for_Screens…
Browse files Browse the repository at this point in the history
…_re-starts_and_showing_twice_if_force_screen_send

2023.9.1-133: Fix for Screens re-starts and showing twice if 'force_screen' send
  • Loading branch information
lubeda authored Nov 17, 2023
2 parents c5132b4 + e4a4cc6 commit c2c32c9
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 @@ -764,9 +764,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 @@ -867,7 +870,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 c2c32c9

Please sign in to comment.