mirror of
https://github.com/esphome/esphome.git
synced 2026-09-29 16:00:23 +00:00
APIServer and WebServer inherited both Component and Controller, so each on_*_update override reached through the registry needed a non-virtual thunk to adjust this to the secondary base, and every publish iterated a StaticVector of Controller pointers with an indirect call. Drop the Controller base class and the runtime list. ControllerRegistry only declares notify_*; code generation defines each one in main.cpp as direct calls on the registered controllers through the entity_types.h X-macro. A ControllerContract concept with a generated static_assert per controller reports a missing callback clearly. On an ESP32 IDF config with api, web_server and four entity types this saves 256 B of flash and 24 B of RAM.