We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b522abf commit d0023dfCopy full SHA for d0023df
1 file changed
meshtastic/mesh_interface.py
@@ -470,9 +470,13 @@ def sendData(
470
"""
471
472
# issue 464: allow for 0x prefix in destinationId for hex values
473
- if type(destinationId) == str:
474
- destinationId = destinationId.replace('0x', '!')
475
- logging.debug(f'destinationId: {destinationId}')
+ # destination ids can either be integers or strings with a !prefix
+ try:
+ int(destinationId)
476
+ except ValueError:
477
+ # only take the last 8 characters of the destinationId and force a ! prefix
478
+ destinationId = f'!{destinationId[-8:]}'
479
+ logging.info(f"Formatted destinationId: {destinationId}")
480
481
if getattr(data, "SerializeToString", None):
482
logging.debug(f"Serializing protobuf as data: {stripnl(data)}")
0 commit comments