Add datetime entities (#6513)
This commit is contained in:
1 parent
bcef64a6fa
commit
8ef7b41c91
51 files changed
+1430
-55
No files matched your search
@@ -94,8 +94,6 @@ void TimeEntityRestoreState::apply(TimeEntity *time) {
|
||||
time->publish_state();
|
||||
}
|
||||
|
||||
#ifdef USE_TIME
|
||||
|
||||
static const int MAX_TIMESTAMP_DRIFT = 900; // how far can the clock drift before we consider
|
||||
// there has been a drastic time synchronization
|
||||
|
||||
@@ -103,7 +101,7 @@ void OnTimeTrigger::loop() {
|
||||
if (!this->parent_->has_state()) {
|
||||
return;
|
||||
}
|
||||
ESPTime time = this->rtc_->now();
|
||||
ESPTime time = this->parent_->rtc_->now();
|
||||
if (!time.is_valid()) {
|
||||
return;
|
||||
}
|
||||
@@ -148,8 +146,6 @@ bool OnTimeTrigger::matches_(const ESPTime &time) const {
|
||||
time.second == this->parent_->second;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace datetime
|
||||
} // namespace esphome
|
||||
|
||||
|
||||
Reference in new issue
Block a user