mirror of
https://github.com/esphome/esphome.git
synced 2025-09-01 10:52:19 +01:00
[api] Dump bytes fields as hex instead of unreadable string (#9288)
This commit is contained in:
@@ -530,7 +530,7 @@ class BytesType(TypeInfo):
|
||||
wire_type = WireType.LENGTH_DELIMITED # Uses wire type 2
|
||||
|
||||
def dump(self, name: str) -> str:
|
||||
o = f'out.append("\'").append({name}).append("\'");'
|
||||
o = f"out.append(format_hex_pretty({name}));"
|
||||
return o
|
||||
|
||||
def get_size_calculation(self, name: str, force: bool = False) -> str:
|
||||
@@ -1255,6 +1255,7 @@ def main() -> None:
|
||||
#include "api_pb2.h"
|
||||
#include "api_pb2_size.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
|
Reference in New Issue
Block a user