From 9848271dedce26d83b8fa491292db86fff1eb536 Mon Sep 17 00:00:00 2001 From: kenstack Date: Wed, 28 Oct 2015 01:21:10 -0400 Subject: [PATCH] Update mm-latest.py add --status-out to options get a clean file of status data like basals-out etc. --- bin/mm-latest.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)