From 226399222d617e000e3d3e20f1cd4f6eb32d514a Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 1 Oct 2025 11:16:07 +1300 Subject: [PATCH] move error message --- esphome/components/api/homeassistant_service.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/api/homeassistant_service.h b/esphome/components/api/homeassistant_service.h index ac568e6518..1a1f9c4810 100644 --- a/esphome/components/api/homeassistant_service.h +++ b/esphome/components/api/homeassistant_service.h @@ -4,6 +4,7 @@ #ifdef USE_API #ifdef USE_API_HOMEASSISTANT_SERVICES #include +#include #include #include "api_pb2.h" #include "esphome/components/json/json_util.h" @@ -49,8 +50,8 @@ template class TemplatableKeyValuePair { // Represents the response data from a Home Assistant action class ActionResponse { public: - ActionResponse(bool success, const std::string &error_message = "") - : success_(success), error_message_(error_message) {} + ActionResponse(bool success, std::string error_message = "") + : success_(success), error_message_(std::move(error_message)) {} bool is_success() const { return this->success_; } const std::string &get_error_message() const { return this->error_message_; }