mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 07:45:56 +00:00
Make time dependency optional (#7425)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -94,6 +94,7 @@ 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
|
||||
|
||||
@@ -145,6 +146,7 @@ bool OnTimeTrigger::matches_(const ESPTime &time) const {
|
||||
return time.is_valid() && 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