Move ESPTime into core esphome namespace (#4926)

* Prep-work for datetime entities

* Fix some includes and remove some restrictions on printing time on displays

* format

* format

* More formatting

* Move function contents

* Ignore clang-tidy
This commit is contained in:
Jesse Hills
2023-06-08 17:24:44 -05:00
committed by GitHub
parent ce13979690
commit 302dea4169
31 changed files with 376 additions and 403 deletions
+2 -4
View File
@@ -158,15 +158,13 @@ void LCDDisplay::clear() {
for (uint8_t i = 0; i < this->rows_ * this->columns_; i++)
this->buffer_[i] = ' ';
}
#ifdef USE_TIME
void LCDDisplay::strftime(uint8_t column, uint8_t row, const char *format, time::ESPTime time) {
void LCDDisplay::strftime(uint8_t column, uint8_t row, const char *format, ESPTime time) {
char buffer[64];
size_t ret = time.strftime(buffer, sizeof(buffer), format);
if (ret > 0)
this->print(column, row, buffer);
}
void LCDDisplay::strftime(const char *format, time::ESPTime time) { this->strftime(0, 0, format, time); }
#endif
void LCDDisplay::strftime(const char *format, ESPTime time) { this->strftime(0, 0, format, time); }
void LCDDisplay::loadchar(uint8_t location, uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
this->command_(LCD_DISPLAY_COMMAND_SET_CGRAM_ADDR | (location << 3));