mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 12:22:20 +01:00
[api] Fix string lifetime issue in Home Assistant service calls with templated values (#9909)
This commit is contained in:
@@ -846,11 +846,11 @@ void NoiseEncryptionSetKeyResponse::calculate_size(uint32_t &total_size) const {
|
||||
#ifdef USE_API_HOMEASSISTANT_SERVICES
|
||||
void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(1, this->key_ref_);
|
||||
buffer.encode_string(2, this->value_ref_);
|
||||
buffer.encode_string(2, this->value);
|
||||
}
|
||||
void HomeassistantServiceMap::calculate_size(uint32_t &total_size) const {
|
||||
ProtoSize::add_string_field(total_size, 1, this->key_ref_.size());
|
||||
ProtoSize::add_string_field(total_size, 1, this->value_ref_.size());
|
||||
ProtoSize::add_string_field(total_size, 1, this->value.size());
|
||||
}
|
||||
void HomeassistantServiceResponse::encode(ProtoWriteBuffer buffer) const {
|
||||
buffer.encode_string(1, this->service_ref_);
|
||||
|
Reference in New Issue
Block a user