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 authored and GitHub committed 2023-06-08 17:24:44 -05:00
1 parent ce13979690
commit 302dea4169
31 files changed
+376 -403

No files matched your search

+2 -4
View File
@@ -368,16 +368,14 @@ uint8_t TM1637Display::printf(const char *format, ...) {
return 0;
}
#ifdef USE_TIME
uint8_t TM1637Display::strftime(uint8_t pos, const char *format, time::ESPTime time) {
uint8_t TM1637Display::strftime(uint8_t pos, const char *format, ESPTime time) {
char buffer[64];
size_t ret = time.strftime(buffer, sizeof(buffer), format);
if (ret > 0)
return this->print(pos, buffer);
return 0;
}
uint8_t TM1637Display::strftime(const char *format, time::ESPTime time) { return this->strftime(0, format, time); }
#endif
uint8_t TM1637Display::strftime(const char *format, ESPTime time) { return this->strftime(0, format, time); }
} // namespace tm1637
} // namespace esphome