Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
fixed issue #19
Browse files Browse the repository at this point in the history
  • Loading branch information
lubeda committed Jul 11, 2022
1 parent 26ea51a commit 7334525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions components/ehmtx/EHMTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ namespace esphome
{
if (this->clock->now().timestamp > 6000) // valid time
{
if (!this->show_date or ((this->clock->now().timestamp - this->next_action_time) < this->clock_time))
time_t ts = this->clock->now().timestamp;
if (!this->show_date or ((this->next_action_time - ts) < this->clock_time))
{
this->display->strftime(this->xoffset + 15, this->yoffset, this->font, this->clock_color, display::TextAlign::BASELINE_CENTER, this->time_fmt.c_str(),
this->clock->now());
Expand Down Expand Up @@ -203,8 +204,8 @@ namespace esphome
}
if (this->show_screen == false)
{
ESP_LOGD(TAG, "next action: show clock for %d sec",this->screen_time);
this->last_clock_time = this->clock->now().timestamp;
ESP_LOGD(TAG, "next action: show clock/date for %d/%d sec",this->clock_time, this->screen_time-this->clock_time);
this->last_clock_time = ts;
this->next_action_time = ts + this->screen_time;
}
else
Expand Down
2 changes: 1 addition & 1 deletion components/ehmtx/EHMTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const uint8_t TEXTSCROLLSTART = 8;
const uint8_t TEXTSTARTOFFSET = (32 - 8);

const uint16_t TICKINTERVAL = 1000; // each 1000ms
static const char *const EHMTX_VERSION = "Version: 2022.6.2";
static const char *const EHMTX_VERSION = "Version: 2022.7.0";
static const char *const TAG = "EHMTX";

namespace esphome
Expand Down

0 comments on commit 7334525

Please sign in to comment.