diff --git a/esphome/components/api/api_server.h b/esphome/components/api/api_server.h index 3c5218af85..5a9b0677bc 100644 --- a/esphome/components/api/api_server.h +++ b/esphome/components/api/api_server.h @@ -149,8 +149,8 @@ class APIServer : public Component, public Controller { #ifdef USE_API_YAML_SERVICES return this->user_services_; #else - static const std::vector empty; - return this->user_services_ ? *this->user_services_ : empty; + static const std::vector EMPTY; + return this->user_services_ ? *this->user_services_ : EMPTY; #endif }