Make time dependency optional (#7425)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
1 parent
49a3d385eb
commit
20cb2e147f
6 files changed
+34
-11
No files matched your search
@@ -192,6 +192,7 @@ void DateTimeEntityRestoreState::apply(DateTimeEntity *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
|
||||
|
||||
@@ -245,6 +246,7 @@ bool OnDateTimeTrigger::matches_(const ESPTime &time) const {
|
||||
time.day_of_month == this->parent_->day && time.hour == this->parent_->hour &&
|
||||
time.minute == this->parent_->minute && time.second == this->parent_->second;
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace datetime
|
||||
} // namespace esphome
|
||||
|
||||
Reference in new issue
Block a user