The struct + constexpr namespace approach caused the compiler to
materialize POLLING_UPDATE as a 4-byte symbol. An enum class with
uint32_t underlying type gives the same type safety but enum values
are true compile-time constants that never get materialized.
Move all set_timeout, cancel_timeout, set_interval, cancel_interval
overloads (const char*, uint32_t, std::string) from scheduler.cpp to
inline in scheduler.h. These are all trivial one-liner forwarding calls
to set_timer_common_ or cancel_item_ and benefit from inlining at
call sites rather than being separate symbols.
Move the 4 Scheduler InternalSchedulerID methods from .cpp to inline
in the header. They're trivial one-liners that extract .id and forward
to set_timer_common_/cancel_item_, so the compiler can fold them into
call sites instead of emitting separate function bodies.
Verifies that NUMERIC_ID_INTERNAL and NUMERIC_ID are completely
independent matching namespaces — same uint32_t value on the same
component does not collide. Tests that cancelling one type does not
affect the other, and that string names also don't cross-match.
Previously, PollingComponent used the string "update" and DelayAction
used "delay" as scheduler names. If a component subclassing
PollingComponent or using DelayAction also happened to use these same
strings for its own timers, the core timer would be silently cancelled
— a subtle bug that would be extremely hard to track down.
This introduces InternalSchedulerID, a type-safe wrapper that routes
through a new NUMERIC_ID_INTERNAL NameType. Since the scheduler
matches by (component, name_type, id, type), internal IDs can never
collide with component-level NUMERIC_ID or string-based names, even
if the underlying uint32_t values overlap.
Also migrates binary_sensor filters, MultiClickTrigger, and sensor
filters from string-based to uint32_t scheduler IDs. Each filter is
its own Component instance so IDs are scoped per-instance with no
collision risk.