diff --git a/esphome/components/api/api_pb2_dump.cpp b/esphome/components/api/api_pb2_dump.cpp index 56aa4683ba..ad5a5fdcaa 100644 --- a/esphome/components/api/api_pb2_dump.cpp +++ b/esphome/components/api/api_pb2_dump.cpp @@ -3132,7 +3132,7 @@ void BluetoothLERawAdvertisement::dump_to(std::string &out) const { out.append("\n"); out.append(" data: "); - out.append(format_hex_pretty(reinterpret_cast(this->data), this->data_len)); + out.append(format_hex_pretty(this->data, this->data_len)); out.append("\n"); out.append("}"); } diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 5d78da6a58..23d8a53b70 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -657,7 +657,7 @@ class FixedArrayBytesType(TypeInfo): return f"buffer.encode_bytes({self.number}, this->{self.field_name}, this->{self.field_name}_len);" def dump(self, name: str) -> str: - o = f"out.append(format_hex_pretty(reinterpret_cast({name}), {name}_len));" + o = f"out.append(format_hex_pretty({name}, {name}_len));" return o def get_size_calculation(self, name: str, force: bool = False) -> str: