Skip to content

decode_entity_location_protobuf

Part of Protobuf helpers in the Python API reference.

Related guidance: how-to/protobuf-decode, reference/wire-formats.

Runnable examples: decode_public_protobuf.py.

from picogrid_ecn_client import decode_entity_location_protobuf

Decode one entity-location update from the supported protobuf subset.

def decode_entity_location_protobuf(
payload: bytes,
*,
integration: str,
maximum_payload_size: int = 1048576,
) -> LocationEvent
NameTypeDefaultDescription
payloadbytesSerialized protobuf payload containing the entity UUID and location.
integrationstrIntegration name carried by the source topic.
maximum_payload_sizeint1048576Inclusive payload limit in bytes, from 1024 through 16777216.
TypeDescription
LocationEventThe decoded typed location event.
ExceptionDescription
ProtocolErrorIf the payload is malformed, lacks required fields, or carries an invalid entity UUID.
ResourceLimitErrorIf the payload exceeds maximum_payload_size bytes.
ValidationErrorIf an input or decoded public field is invalid.

Source · protobuf.py

Version 0.2.0 · branch main