Skip to content

Commit

Permalink
Update __main__.py
Browse files Browse the repository at this point in the history
Simple patch to fix the ignore_incoming management aka
#568
  • Loading branch information
868meshbot authored May 25, 2024
1 parent 8d538e8 commit bcd60c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,14 @@ def setPref(config, comp_name, valStr) -> bool:
config_values = getattr(config_part, config_type.name)
setattr(config_values, pref.name, valStr)
else:
config_values = getattr(config, config_type.name)

Check warning on line 229 in meshtastic/__main__.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/__main__.py#L229

Added line #L229 was not covered by tests
if val == 0:
# clear values
print("Clearing ignore_incoming list")
del config_type.message_type.ignore_incoming[:]
del config_values.ignore_incoming[:]

Check warning on line 233 in meshtastic/__main__.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/__main__.py#L233

Added line #L233 was not covered by tests
else:
print(f"Adding '{val}' to the ignore_incoming list")
config_type.message_type.ignore_incoming.extend([val])
config_values.ignore_incoming.extend([int(valStr)])

Check warning on line 236 in meshtastic/__main__.py

View check run for this annotation

Codecov / codecov/patch

meshtastic/__main__.py#L236

Added line #L236 was not covered by tests

prefix = f"{'.'.join(name[0:-1])}." if config_type.message_type is not None else ""
if mt_config.camel_case:
Expand Down

0 comments on commit bcd60c9

Please sign in to comment.