mirror of
https://github.com/meshtastic/python.git
synced 2025-12-29 10:57:53 -05:00
fix empty string for bytes() params (fixes --setchan psk "")
This commit is contained in:
@@ -74,7 +74,9 @@ def fromStr(valstr):
|
||||
Args:
|
||||
valstr (string): A user provided string
|
||||
"""
|
||||
if(valstr.startswith('0x')):
|
||||
if(len(valstr) == 0): # Treat an emptystring as an empty bytes
|
||||
val = bytes()
|
||||
elif(valstr.startswith('0x')):
|
||||
# if needed convert to string with asBytes.decode('utf-8')
|
||||
val = bytes.fromhex(valstr[2:])
|
||||
elif valstr in trueTerms:
|
||||
|
||||
Reference in New Issue
Block a user