@@ -131,7 +131,8 @@ namespace esphome
131131 {
132132 if (this ->clock ->now ().timestamp > 6000 ) // valid time
133133 {
134- if (!this ->show_date or ((this ->clock ->now ().timestamp - this ->next_action_time ) < this ->clock_time ))
134+ time_t ts = this ->clock ->now ().timestamp ;
135+ if (!this ->show_date or ((this ->next_action_time - ts) < this ->clock_time ))
135136 {
136137 this ->display ->strftime (this ->xoffset + 15 , this ->yoffset , this ->font , this ->clock_color , display::TextAlign::BASELINE_CENTER, this ->time_fmt .c_str (),
137138 this ->clock ->now ());
@@ -203,13 +204,13 @@ namespace esphome
203204 }
204205 if (this ->show_screen == false )
205206 {
206- ESP_LOGD (TAG, " next action: show clock for %d sec" ,this ->screen_time );
207- this ->last_clock_time = this -> clock -> now (). timestamp ;
207+ ESP_LOGD (TAG, " next action: show clock/date for %d/%d sec" ,this ->clock_time , this -> screen_time - this -> clock_time );
208+ this ->last_clock_time = ts ;
208209 this ->next_action_time = ts + this ->screen_time ;
209210 }
210211 else
211212 {
212- ESP_LOGD (TAG, " next action: show screen for %d sec" , this ->store ->current ()->display_duration );
213+ 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 );
213214 this ->next_action_time = ts + this ->store ->current ()->display_duration ;
214215 for (auto *t : on_next_screen_triggers_)
215216 {
@@ -238,8 +239,8 @@ namespace esphome
238239 this ->clock ->now ().hour , this ->clock ->now ().minute );
239240 ESP_LOGI (TAG, " status brightness: %d (0..255)" , this ->brightness_ );
240241 ESP_LOGI (TAG, " status default duration: %d" , this ->duration );
241- ESP_LOGI (TAG, " status date format: %s" , this ->date_fmt );
242- ESP_LOGI (TAG, " status time format: %s" , this ->time_fmt );
242+ ESP_LOGI (TAG, " status date format: %s" , this ->date_fmt . c_str () );
243+ ESP_LOGI (TAG, " status time format: %s" , this ->time_fmt . c_str () );
243244 ESP_LOGI (TAG, " status text_color: RGB(%d,%d,%d)" , this ->text_color .r , this ->text_color .g , this ->text_color .b );
244245 ESP_LOGI (TAG, " status alarm_color: RGB(%d,%d,%d)" , this ->alarm_color .r , this ->alarm_color .g , this ->alarm_color .b );
245246 if (this ->show_indicator )
@@ -415,6 +416,8 @@ namespace esphome
415416 ESP_LOGCONFIG (TAG, " Icons: %d of %d" , this ->icon_count , MAXICONS);
416417 ESP_LOGCONFIG (TAG, " Font offset: x=%d y=%d" , this ->xoffset , this ->yoffset );
417418 ESP_LOGCONFIG (TAG, " Max screens: %d" , MAXQUEUE);
419+ ESP_LOGCONFIG (TAG, " Date format: %s" , this ->date_fmt .c_str ());
420+ ESP_LOGCONFIG (TAG, " Time format: %s" , this ->time_fmt .c_str ());
418421 ESP_LOGCONFIG (TAG, " Intervall (ms) scroll: %d anim: %d" , this ->scroll_intervall , this ->anim_intervall );
419422 ESP_LOGCONFIG (TAG, " Displaytime (s) clock: %d screen: %d" , this ->clock_time , this ->screen_time );
420423 if (this ->show_day_of_week )
0 commit comments