mirror of
https://github.com/esphome/esphome.git
synced 2026-10-04 18:11:29 +00:00
[api] Collapse the generator's per wire type decode hooks into one
A type now sets a single decode_expr; the wire type it already declares picks the case label. Drops the unused force_str helper, two dead decode_length overrides, a duplicate field builder in the generator tests and a needless list copy in the state waiter. The generated files are unchanged.
This commit is contained in:
@@ -38,7 +38,8 @@ def _file_with_messages(
|
||||
file_desc = descriptor_pb2.FileDescriptorProto(name="test.proto")
|
||||
for name, field_type, deprecated in messages:
|
||||
msg = file_desc.message_type.add(name=name)
|
||||
field = msg.field.add(name="value", number=1, type=field_type)
|
||||
field = msg.field.add()
|
||||
field.CopyFrom(_field(field_type))
|
||||
field.options.deprecated = deprecated
|
||||
return file_desc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user