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,6 +1,8 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/time.h"
#include "esphome/components/sun/sun.h"
#include "esphome/components/text_sensor/text_sensor.h"
@@ -15,7 +17,7 @@ class SunTextSensor : public text_sensor::TextSensor, public PollingComponent {
void set_format(const std::string &format) { format_ = format; }
void update() override {
optional<time::ESPTime> res;
optional<ESPTime> res;
if (this->sunrise_) {
res = this->parent_->sunrise(this->elevation_);
} else {