mirror of
https://github.com/esphome/esphome.git
synced 2025-08-01 07:57:47 +00:00
preen
This commit is contained in:
parent
9cb86241b9
commit
ae7aa4c0ef
@ -831,8 +831,6 @@ bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthD
|
|||||||
switch (field_id) {
|
switch (field_id) {
|
||||||
case 1:
|
case 1:
|
||||||
this->key = value.as_string();
|
this->key = value.as_string();
|
||||||
this->key_ptr_ = reinterpret_cast<const uint8_t *>(this->key.data());
|
|
||||||
this->key_len_ = this->key.size();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -2001,8 +1999,6 @@ bool BluetoothGATTWriteRequest::decode_length(uint32_t field_id, ProtoLengthDeli
|
|||||||
switch (field_id) {
|
switch (field_id) {
|
||||||
case 4:
|
case 4:
|
||||||
this->data = value.as_string();
|
this->data = value.as_string();
|
||||||
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
|
|
||||||
this->data_len_ = this->data.size();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -2039,8 +2035,6 @@ bool BluetoothGATTWriteDescriptorRequest::decode_length(uint32_t field_id, Proto
|
|||||||
switch (field_id) {
|
switch (field_id) {
|
||||||
case 3:
|
case 3:
|
||||||
this->data = value.as_string();
|
this->data = value.as_string();
|
||||||
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
|
|
||||||
this->data_len_ = this->data.size();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@ -2263,8 +2257,6 @@ bool VoiceAssistantAudio::decode_length(uint32_t field_id, ProtoLengthDelimited
|
|||||||
switch (field_id) {
|
switch (field_id) {
|
||||||
case 1:
|
case 1:
|
||||||
this->data = value.as_string();
|
this->data = value.as_string();
|
||||||
this->data_ptr_ = reinterpret_cast<const uint8_t *>(this->data.data());
|
|
||||||
this->data_len_ = this->data.size();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -634,12 +634,10 @@ class BytesType(TypeInfo):
|
|||||||
if not self.needs_decode:
|
if not self.needs_decode:
|
||||||
return "" # No decode needed for SOURCE_SERVER messages
|
return "" # No decode needed for SOURCE_SERVER messages
|
||||||
|
|
||||||
# Decode into storage and update pointer/length
|
# Decode into storage only - pointer/length are only needed for encoding
|
||||||
return (
|
return (
|
||||||
f"case {self.number}:\n"
|
f"case {self.number}:\n"
|
||||||
f" this->{self.field_name} = value.as_string();\n"
|
f" this->{self.field_name} = value.as_string();\n"
|
||||||
f" this->{self.field_name}_ptr_ = reinterpret_cast<const uint8_t*>(this->{self.field_name}.data());\n"
|
|
||||||
f" this->{self.field_name}_len_ = this->{self.field_name}.size();\n"
|
|
||||||
f" break;"
|
f" break;"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user