We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb88ee1 commit 426795fCopy full SHA for 426795f
meshtastic/util.py
@@ -675,5 +675,8 @@ def check_if_newer_version() -> Optional[str]:
675
676
def message_to_json(message: Message, multiline: bool=False) -> str:
677
"""Return protobuf message as JSON. Always print all fields, even when not present in data."""
678
- json = MessageToJson(message, always_print_fields_with_no_presence=True)
+ try:
679
+ json = MessageToJson(message, always_print_fields_with_no_presence=True)
680
+ except TypeError:
681
+ json = MessageToJson(message, including_default_value_fields=True)
682
return stripnl(json) if not multiline else json
0 commit comments