diff --git a/esphome/components/api/api_server.cpp b/esphome/components/api/api_server.cpp index cec225f385..d21658c940 100644 --- a/esphome/components/api/api_server.cpp +++ b/esphome/components/api/api_server.cpp @@ -18,6 +18,7 @@ #endif #include +#include namespace esphome::api { @@ -404,7 +405,7 @@ void APIServer::send_homeassistant_action(const HomeassistantActionRequest &call } void APIServer::register_action_response_callback(uint32_t call_id, ActionResponseCallback callback) { - this->action_response_callbacks_[call_id] = callback; + this->action_response_callbacks_[call_id] = std::move(callback); } void APIServer::handle_action_response(uint32_t call_id, bool success, const std::string &error_message,