Skip to content

Commit

Permalink
2023.9.1: Fix blank icon_clock icon_date screen on vertical scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjswan authored Nov 20, 2023
1 parent 4418fd7 commit cae0bed
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions components/ehmtxv2/EHMTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ namespace esphome
screen->mode = MODE_BITMAP_SCREEN;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process("bitmap", (uint8_t)screen->mode);
Expand Down Expand Up @@ -1345,6 +1349,10 @@ namespace esphome
screen->progress = (progress > 100) ? 100 : (progress < -100) ? -100 : progress;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process(screen->icon_name, (uint8_t)screen->mode);
Expand Down Expand Up @@ -1424,6 +1432,10 @@ namespace esphome
screen->icon = icon;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process(screen->icon_name, (uint8_t)screen->mode);
Expand Down Expand Up @@ -1457,6 +1469,10 @@ namespace esphome
screen->icon = icon;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process(screen->icon_name, (uint8_t)screen->mode);
Expand Down Expand Up @@ -1514,6 +1530,10 @@ namespace esphome
{
screen->screen_time_ = EHMTXv2_CLOCK_INTERVALL * 1000.0 - 2000.0;
}
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
screen->status();
}
Expand All @@ -1527,6 +1547,10 @@ namespace esphome
screen->default_font = default_font;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
screen->status();
}

Expand Down Expand Up @@ -1588,6 +1612,10 @@ namespace esphome
screen->icon = 0;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process("Fire", (uint8_t)screen->mode);
Expand Down Expand Up @@ -1616,6 +1644,10 @@ namespace esphome
screen->icon_name = iconname;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
for (auto *t : on_add_screen_triggers_)
{
t->process(screen->icon_name, (uint8_t)screen->mode);
Expand All @@ -1633,6 +1665,10 @@ namespace esphome
screen->default_font = default_font;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
screen->status();
}

Expand All @@ -1647,6 +1683,10 @@ namespace esphome
screen->default_font = default_font;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif
screen->status();
}

Expand Down Expand Up @@ -1913,6 +1953,10 @@ namespace esphome
screen->icon = MAXICONS;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif

this->graph->set_height(8);
this->graph->set_width(32);
Expand Down Expand Up @@ -1946,6 +1990,10 @@ namespace esphome
screen->icon_name = iconname;
screen->screen_time_ = screen_time * 1000.0;
screen->endtime = this->get_tick() + (lifetime > 0 ? lifetime * 60000.0 : screen->screen_time_);
#ifdef EHMTXv2_USE_VERTICAL_SCROLL
this->pixels_ = 0;
screen->scroll_reset = 32;
#endif

this->graph->set_height(8);
this->graph->set_width(24);
Expand Down

0 comments on commit cae0bed

Please sign in to comment.