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

Commit

Permalink
Merge pull request #21 from lubeda/2022.7.0
Browse files Browse the repository at this point in the history
2022.7.0
  • Loading branch information
lubeda committed Jul 23, 2022
2 parents bc0c299 + 7334525 commit a76f63d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 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,13 +204,13 @@ 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
{
ESP_LOGD(TAG, "next action: show screen for %d sec", this->store->current()->display_duration);
ESP_LOGD(TAG, "next action: show screen \"%s\" for %d sec", this->icons[this->store->current()->icon]->name.c_str() ,this->store->current()->display_duration);
this->next_action_time = ts + this->store->current()->display_duration;
for (auto *t : on_next_screen_triggers_)
{
Expand Down Expand Up @@ -238,8 +239,8 @@ namespace esphome
this->clock->now().hour, this->clock->now().minute);
ESP_LOGI(TAG, "status brightness: %d (0..255)", this->brightness_);
ESP_LOGI(TAG, "status default duration: %d", this->duration);
ESP_LOGI(TAG, "status date format: %s", this->date_fmt);
ESP_LOGI(TAG, "status time format: %s", this->time_fmt);
ESP_LOGI(TAG, "status date format: %s", this->date_fmt.c_str());
ESP_LOGI(TAG, "status time format: %s", this->time_fmt.c_str());
ESP_LOGI(TAG, "status text_color: RGB(%d,%d,%d)", this->text_color.r, this->text_color.g, this->text_color.b);
ESP_LOGI(TAG, "status alarm_color: RGB(%d,%d,%d)", this->alarm_color.r, this->alarm_color.g, this->alarm_color.b);
if (this->show_indicator)
Expand Down Expand Up @@ -415,6 +416,8 @@ namespace esphome
ESP_LOGCONFIG(TAG, "Icons: %d of %d", this->icon_count, MAXICONS);
ESP_LOGCONFIG(TAG, "Font offset: x=%d y=%d", this->xoffset, this->yoffset);
ESP_LOGCONFIG(TAG, "Max screens: %d", MAXQUEUE);
ESP_LOGCONFIG(TAG, "Date format: %s", this->date_fmt.c_str());
ESP_LOGCONFIG(TAG, "Time format: %s", this->time_fmt.c_str());
ESP_LOGCONFIG(TAG, "Intervall (ms) scroll: %d anim: %d", this->scroll_intervall, this->anim_intervall);
ESP_LOGCONFIG(TAG, "Displaytime (s) clock: %d screen: %d", this->clock_time, this->screen_time);
if (this->show_day_of_week)
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 a76f63d

Please sign in to comment.