Skip to content

Commit 9ea2cfd

Browse files
committed
scripts: reboot_count_reset: support multiple app IDs
Support resetting multiple app IDs at once. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent f90ccb7 commit 9ea2cfd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/reboot_count_reset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class RebootCountResetter:
2323
def __init__(self, args: argparse.Namespace):
24-
self.app_id = args.app
24+
self.app_ids = args.app
2525
self.count = args.count
2626
self.client = LocalClient(default_multicast_address(), 1.0)
2727
self.decoder = TDF()
@@ -49,7 +49,7 @@ def state_update(self, live: Live, state: str):
4949
live.update(self.progress_table())
5050

5151
def announce_observed(self, live: Live, infuse_id: int, pkt: readings.announce | readings.announce_v2):
52-
if pkt.application != self.app_id:
52+
if pkt.application not in self.app_ids:
5353
return
5454
if pkt.reboots == self.count:
5555
if (infuse_id not in self.already) and (infuse_id not in self.updated):
@@ -87,7 +87,7 @@ def run(self):
8787
if __name__ == "__main__":
8888
parser = argparse.ArgumentParser("Reset reboot counters to a common value")
8989
addr_group = parser.add_mutually_exclusive_group(required=True)
90-
addr_group.add_argument("--app", type=lambda x: int(x, 0), help="Application ID to reset")
90+
addr_group.add_argument("--app", type=lambda x: int(x, 0), action="append", help="Application ID to reset")
9191
parser.add_argument("--count", type=int, default=0, help="Value to reset count to")
9292

9393
args = parser.parse_args()

0 commit comments

Comments
 (0)