diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index c5d77a79bc..089995b275 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -291,8 +291,8 @@ class ProtoWriteBuffer { // size_t overload (only enabled if size_t is distinct from uint32_t and uint64_t) template - requires(std::is_same_v && !std::is_same_v && - !std::is_same_v) void encode_varint(T value) { + void encode_varint(T value) requires(std::is_same_v && !std::is_same_v && + !std::is_same_v) { this->encode_varint(static_cast(value)); }