Skip to content

Commit 578d3e4

Browse files
committed
do not double-print value when setting a repeated value
When clearning or appending to a repeated value, both the "Clearing..." / "Adding..." line and the "Set..." line were shown. However, this is misleading as the only performed operation is the clearing / appending. We fix this by directly returning from the function in case of clearing / appending.
1 parent 4ca13bc commit 578d3e4

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

meshtastic/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def setPref(config, comp_name, raw_val) -> bool:
256256
cur_vals = [x for x in getattr(config_values, pref.name) if x not in [0, "", b""]]
257257
cur_vals.append(val)
258258
getattr(config_values, pref.name)[:] = cur_vals
259+
return True
259260

260261
prefix = f"{'.'.join(name[0:-1])}." if config_type.message_type is not None else ""
261262
print(f"Set {prefix}{uni_name} to {raw_val}")

0 commit comments

Comments
 (0)