diff --git a/bin/mm-latest.py b/bin/mm-latest.py index f1452e2..673cf6b 100755 --- a/bin/mm-latest.py +++ b/bin/mm-latest.py @@ -88,6 +88,12 @@ def customize_parser (self, parser): type=argparse.FileType('w'), help="Put basal schedules json in this file" ) + parser.add_argument('--status-out', + dest="status", + default='-', + type=argparse.FileType('w'), + help="Put status json in this file" + ) parser.add_argument('--timezone', default=gettz( ), type=gettz, @@ -121,6 +127,7 @@ def report_clock (self, args): def report_status (self, args): status = self.exec_request(self.pump, commands.ReadPumpStatus) self.status = status.getData( ) + args.status.write(json.dumps(self.status, indent=2)) def report_temp (self, args): temp = self.exec_request(self.pump, commands.ReadBasalTemp)