From 12795852ca5053692dbbdb80138f70630d501cd2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 10 Sep 2026 20:41:03 -0500 Subject: [PATCH] [remote_base] Name the fix at compile time when no slot was counted --- esphome/components/remote_base/remote_base.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/esphome/components/remote_base/remote_base.h b/esphome/components/remote_base/remote_base.h index 9b2b85fef0..7f23d27a56 100644 --- a/esphome/components/remote_base/remote_base.h +++ b/esphome/components/remote_base/remote_base.h @@ -212,11 +212,21 @@ class RemoteReceiverDumperBase { class RemoteReceiverBase : public RemoteComponentBase { public: RemoteReceiverBase(InternalGPIOPin *pin) : RemoteComponentBase(pin) {} + // Slots are counted at code generation; without one the call fails at compile time with the same message + // the runtime check logs #ifdef REMOTE_BASE_LISTENER_COUNT void register_listener(RemoteReceiverListener *listener); +#else + template void register_listener(T *) { + static_assert(sizeof(T) == 0, "No listener slot: register it from to_code() with remote_base.add_listener"); + } #endif #ifdef REMOTE_BASE_DUMPER_COUNT void register_dumper(RemoteReceiverDumperBase *dumper); +#else + template void register_dumper(T *) { + static_assert(sizeof(T) == 0, "No dumper slot: register it from to_code() with remote_base.add_dumper"); + } #endif void set_tolerance(uint32_t tolerance, ToleranceMode tolerance_mode) { this->tolerance_ = tolerance;