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
@@ -1,16 +1,13 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include "esphome/core/time.h"
#include "esphome/components/display/display_buffer.h"
#include "esphome/components/spi/spi.h"
#include <vector>
#ifdef USE_TIME
#include "esphome/components/time/real_time_clock.h"
#endif
namespace esphome {
namespace max7219digit {
@@ -88,13 +85,11 @@ class MAX7219Component : public PollingComponent,
/// Print `str` at position 0.
uint8_t printdigit(const char *str);
#ifdef USE_TIME
/// Evaluate the strftime-format and print the result at the given position.
uint8_t strftimedigit(uint8_t pos, const char *format, time::ESPTime time) __attribute__((format(strftime, 3, 0)));
uint8_t strftimedigit(uint8_t pos, const char *format, ESPTime time) __attribute__((format(strftime, 3, 0)));
/// Evaluate the strftime-format and print the result at position 0.
uint8_t strftimedigit(const char *format, time::ESPTime time) __attribute__((format(strftime, 2, 0)));
#endif
uint8_t strftimedigit(const char *format, ESPTime time) __attribute__((format(strftime, 2, 0)));
display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_BINARY; }