diff --git a/AGENTS.md b/AGENTS.md index 3a5faa6b886..aaea715d536 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -179,7 +179,7 @@ file does, and it is the authority when they disagree. The most useful starting `set_interval`. Full reasoning, including why `set_interval` costs more below 500 ms: https://developers.esphome.io/architecture/components/advanced/#quick-rule-of-thumb * **Repeating work:** use `set_interval`, never a `set_timeout` that re-arms itself; every re-arm - allocates a new scheduler item. + rebuilds the callback and re-queues a scheduler item, and the period drifts. * **Scheduler ids:** name a timer only when it must be cancelled or replaced, and use a `static constexpr uint32_t` id, never a string. Ids are per component instance and cannot clash with other components, so number them from 0 and keep all of a component's ids together in one place.