From e241e430647ba589bbd31917b9148424d5f6d327 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Oct 2025 21:41:49 -1000 Subject: [PATCH 1/2] preen --- .../components/api/homeassistant_service.h | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/esphome/components/api/homeassistant_service.h b/esphome/components/api/homeassistant_service.h index b24a6470fe..bd668d3cf8 100644 --- a/esphome/components/api/homeassistant_service.h +++ b/esphome/components/api/homeassistant_service.h @@ -122,24 +122,14 @@ template class HomeAssistantServiceCallAction : public Action *get_error_trigger() const { return this->error_trigger_; } #endif // USE_API_HOMEASSISTANT_ACTION_RESPONSES - template - static void populate_service_map(VectorType &dest, SourceType &source, Ts... x) { - dest.init(source.size()); - for (auto &it : source) { - auto &kv = dest.emplace_back(); - kv.set_key(StringRef(it.key)); - kv.value = it.value.value(x...); - } - } - void play(Ts... x) override { HomeassistantActionRequest resp; std::string service_value = this->service_.value(x...); resp.set_service(StringRef(service_value)); resp.is_event = this->flags_.is_event; - populate_service_map(resp.data, this->data_, x...); - populate_service_map(resp.data_template, this->data_template_, x...); - populate_service_map(resp.variables, this->variables_, x...); + this->populate_service_map_(resp.data, this->data_, x...); + this->populate_service_map_(resp.data_template, this->data_template_, x...); + this->populate_service_map_(resp.variables, this->variables_, x...); #ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES if (this->flags_.wants_status) { @@ -184,6 +174,16 @@ template class HomeAssistantServiceCallAction : public Action + static void populate_service_map(VectorType &dest, SourceType &source, Ts... x) { + dest.init(source.size()); + for (auto &it : source) { + auto &kv = dest.emplace_back(); + kv.set_key(StringRef(it.key)); + kv.value = it.value.value(x...); + } + } + APIServer *parent_; TemplatableStringValue service_{}; std::vector> data_; From 0fca842afe9212189b8503908475fb26ab9dd756 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Oct 2025 21:41:57 -1000 Subject: [PATCH 2/2] preen --- esphome/components/api/homeassistant_service.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/api/homeassistant_service.h b/esphome/components/api/homeassistant_service.h index bd668d3cf8..9c2844fbed 100644 --- a/esphome/components/api/homeassistant_service.h +++ b/esphome/components/api/homeassistant_service.h @@ -175,7 +175,7 @@ template class HomeAssistantServiceCallAction : public Action - static void populate_service_map(VectorType &dest, SourceType &source, Ts... x) { + static void populate_service_map_(VectorType &dest, SourceType &source, Ts... x) { dest.init(source.size()); for (auto &it : source) { auto &kv = dest.emplace_back();