mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-28 08:48:27 +02:00
time sync notification (#1442)
* add on_time_sync trigger * cleanup lint * fix review remark (sntp didn't trigger callbacks)
This commit is contained in:
committed by
Jesse Hills
parent
828f7946ea
commit
6781d08c9b
@@ -75,5 +75,9 @@ void CronTrigger::add_days_of_week(const std::vector<uint8_t> &days_of_week) {
|
||||
}
|
||||
float CronTrigger::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
|
||||
SyncTrigger::SyncTrigger(RealTimeClock *rtc) : rtc_(rtc) {
|
||||
rtc->add_on_time_sync_callback([this]() { this->trigger(); });
|
||||
}
|
||||
|
||||
} // namespace time
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user