mirror of
https://github.com/esphome/esphome.git
synced 2026-10-26 16:02:13 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
917d4f50a0 | ||
|
|
2378962512 | ||
|
|
c4d89c89ff |
No files matched your search
@@ -32,9 +32,9 @@ struct DateEntityRestoreState {
|
||||
|
||||
class DateEntity : public DateTimeBase {
|
||||
protected:
|
||||
uint16_t year_;
|
||||
uint8_t month_;
|
||||
uint8_t day_;
|
||||
uint16_t year_{0};
|
||||
uint8_t month_{0};
|
||||
uint8_t day_{0};
|
||||
|
||||
public:
|
||||
void publish_state();
|
||||
|
||||
@@ -27,7 +27,7 @@ class DateTimeBase : public EntityBase {
|
||||
LazyCallbackManager<void()> state_callback_;
|
||||
|
||||
#ifdef USE_TIME
|
||||
time::RealTimeClock *rtc_;
|
||||
time::RealTimeClock *rtc_{nullptr};
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -35,12 +35,12 @@ struct DateTimeEntityRestoreState {
|
||||
|
||||
class DateTimeEntity : public DateTimeBase {
|
||||
protected:
|
||||
uint16_t year_;
|
||||
uint8_t month_;
|
||||
uint8_t day_;
|
||||
uint8_t hour_;
|
||||
uint8_t minute_;
|
||||
uint8_t second_;
|
||||
uint16_t year_{0};
|
||||
uint8_t month_{0};
|
||||
uint8_t day_{0};
|
||||
uint8_t hour_{0};
|
||||
uint8_t minute_{0};
|
||||
uint8_t second_{0};
|
||||
|
||||
public:
|
||||
void publish_state();
|
||||
|
||||
@@ -33,9 +33,9 @@ struct TimeEntityRestoreState {
|
||||
|
||||
class TimeEntity : public DateTimeBase {
|
||||
protected:
|
||||
uint8_t hour_;
|
||||
uint8_t minute_;
|
||||
uint8_t second_;
|
||||
uint8_t hour_{0};
|
||||
uint8_t minute_{0};
|
||||
uint8_t second_{0};
|
||||
|
||||
public:
|
||||
void publish_state();
|
||||
|
||||
@@ -28,7 +28,7 @@ class Number;
|
||||
*/
|
||||
class Number : public EntityBase {
|
||||
public:
|
||||
float state{};
|
||||
float state;
|
||||
|
||||
void publish_state(float state);
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace esphome::template_ {
|
||||
|
||||
class TemplateTime final : public datetime::TimeEntity, public PollingComponent {
|
||||
public:
|
||||
// User provided, not "= default": `new(p) TemplateTime()` would zero-fill .bss that is already zero.
|
||||
TemplateTime() {}
|
||||
template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
|
||||
|
||||
void setup() override;
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
namespace esphome::template_ {
|
||||
|
||||
TemplateNumber::TemplateNumber() {}
|
||||
|
||||
static const char *const TAG = "template.number";
|
||||
|
||||
void TemplateNumber::setup() {
|
||||
|
||||
@@ -10,9 +10,6 @@ namespace esphome::template_ {
|
||||
|
||||
class TemplateNumber final : public number::Number, public PollingComponent {
|
||||
public:
|
||||
// User provided, not "= default": `new(p) TemplateNumber()` would zero-fill .bss that is already zero.
|
||||
// Defined out of line so the member constructors are not inlined into every construction site.
|
||||
TemplateNumber();
|
||||
template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
|
||||
|
||||
void setup() override;
|
||||
|
||||
Reference in new issue
Block a user