Skip to content

Commit

Permalink
2023.9.1: Improve logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjswan authored Oct 12, 2023
1 parent ea80495 commit a159822
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 54 deletions.
64 changes: 13 additions & 51 deletions components/ehmtxv2/EHMTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,22 +806,9 @@ namespace esphome
}
ESP_LOGI(TAG, "status time format: %s", EHMTXv2_TIME_FORMAT);
ESP_LOGI(TAG, "status date format: %s", EHMTXv2_DATE_FORMAT);
if (this->show_display)
{
ESP_LOGI(TAG, "status display on");
}
else
{
ESP_LOGI(TAG, "status display off");
}
if (this->night_mode)
{
ESP_LOGI(TAG, "status night mode on");
}
else
{
ESP_LOGI(TAG, "status night mode off");
}
ESP_LOGI(TAG, "status display %s", this->show_display ? F("on") : F("off"));
ESP_LOGI(TAG, "status night mode %s", this->night_mode ? F("on") : F("off"));
ESP_LOGI(TAG, "status replace time and date %s", this->replace_time_date_active ? F("on") : F("off"));

this->queue_status();
}
Expand Down Expand Up @@ -853,14 +840,7 @@ namespace esphome
void EHMTX::set_replace_time_date_active(bool b)
{
this->replace_time_date_active = b;
if (b)
{
ESP_LOGI(TAG, "replace_time_date on");
}
else
{
ESP_LOGI(TAG, "replace_time_date off");
}
ESP_LOGI(TAG, "replace_time_date %s", b ? F("on") : F("off"));
}

std::string EHMTX::replace_time_date(std::string time_date) // Replace Time Date Strings / Trip5
Expand Down Expand Up @@ -1358,27 +1338,13 @@ namespace esphome
void EHMTX::set_show_seconds(bool b)
{
this->show_seconds = b;
if (b)
{
ESP_LOGI(TAG, "show seconds");
}
else
{
ESP_LOGI(TAG, "don't show seconds");
}
ESP_LOGI(TAG, "%sshow seconds", b ? F("") : F("don't "));
}

void EHMTX::set_show_day_of_week(bool b)
{
this->show_day_of_week = b;
if (b)
{
ESP_LOGI(TAG, "show day of week");
}
else
{
ESP_LOGI(TAG, "don't show day of week");
}
ESP_LOGI(TAG, "%sshow day of week", b ? F("") : F("don't "));
}

void EHMTX::set_brightness(int value)
Expand Down Expand Up @@ -1613,25 +1579,21 @@ namespace esphome
ESP_LOGCONFIG(TAG, "Interval (ms) scroll: %d", EHMTXv2_SCROLL_INTERVALL);
if (this->show_day_of_week)
{
ESP_LOGCONFIG(TAG, "show day of week");
ESP_LOGCONFIG(TAG, "Show day of week");
}
#ifdef EHMTXv2_USE_RTL
ESP_LOGCONFIG(TAG, "RTL activated");
#endif
#ifdef EHMTXv2_BLEND_STEPS
ESP_LOGCONFIG(TAG, "Fade in activated: %d steps", EHMTXv2_BLEND_STEPS);
#endif
if (EHMTXv2_WEEK_START)
{
ESP_LOGCONFIG(TAG, "weekstart: monday");
}
else
{
ESP_LOGCONFIG(TAG, "weekstart: sunday");
}
ESP_LOGCONFIG(TAG, "Weekstart: %s", EHMTXv2_WEEK_START ? F("Monday") : F("Sunday"));
ESP_LOGCONFIG(TAG, "Weekdays: %s Count: %d", EHMTXv2_WEEKDAYTEXT, this->GetWeekdayCharCount());
ESP_LOGCONFIG(TAG, "Display: %s", this->show_display ? "On" : "Off");
ESP_LOGCONFIG(TAG, "Night mode: %s", this->night_mode ? "On" : "Off");
ESP_LOGCONFIG(TAG, "Display: %s", this->show_display ? F("On") : F("Off"));
ESP_LOGCONFIG(TAG, "Night mode: %s", this->night_mode ? F("On") : F("Off"));
ESP_LOGCONFIG(TAG, "Replace Time and Date: %s", this->replace_time_date_active ? F("On") : F("Off"));
ESP_LOGCONFIG(TAG, "Replace from: %s", EHMTXv2_REPLACE_TIME_DATE_FROM);
ESP_LOGCONFIG(TAG, "Replace to : %s", EHMTXv2_REPLACE_TIME_DATE_TO);
}

void EHMTX::add_icon(EHMTX_Icon *icon)
Expand Down
4 changes: 1 addition & 3 deletions components/ehmtxv2/EHMTX_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace esphome
switch (this->mode)
{
case MODE_EMPTY:
ESP_LOGD(TAG, ("empty slot"));
ESP_LOGD(TAG, "empty slot");
break;
case MODE_BLANK:
ESP_LOGD(TAG, "queue: blank screen for %d sec", this->screen_time_);
Expand Down Expand Up @@ -729,5 +729,3 @@ namespace esphome
}

}


0 comments on commit a159822

Please sign in to comment.