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-09 10:24:44 +12:00
committed by GitHub
parent ce13979690
commit 302dea4169
31 changed files with 376 additions and 403 deletions
+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