1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-22 11:43:51 +01:00

Merge branch 'fixed_vector_HomeassistantServiceMap' into integration

This commit is contained in:
J. Nick Koston
2025-10-13 21:46:09 -10:00

View File

@@ -127,9 +127,9 @@ template<typename... Ts> class HomeAssistantServiceCallAction : public Action<Ts
std::string service_value = this->service_.value(x...); std::string service_value = this->service_.value(x...);
resp.set_service(StringRef(service_value)); resp.set_service(StringRef(service_value));
resp.is_event = this->flags_.is_event; resp.is_event = this->flags_.is_event;
this->populate_service_map_(resp.data, this->data_, 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.data_template, this->data_template_, x...);
this->populate_service_map_(resp.variables, this->variables_, x...); this->populate_service_map(resp.variables, this->variables_, x...);
#ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES #ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES
if (this->flags_.wants_status) { if (this->flags_.wants_status) {
@@ -175,7 +175,7 @@ template<typename... Ts> class HomeAssistantServiceCallAction : public Action<Ts
protected: protected:
template<typename VectorType, typename SourceType> template<typename VectorType, typename SourceType>
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()); dest.init(source.size());
for (auto &it : source) { for (auto &it : source) {
auto &kv = dest.emplace_back(); auto &kv = dest.emplace_back();