Compare commits

...
3 Commits
Author SHA1 Message Date
James Woglom 64aeb4d752 v2.3.1 2025-06-08 17:17:13 -04:00
James Woglom 6a9a426b97 explicit time_start/time_end for autoupdate 2025-06-08 11:07:57 -04:00
samfundevandJames Woglom 5a76a4cfd1 Fix auto-update only running for 24 hours
Fixes #11
2025-06-08 11:06:24 -04:00
3 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata]
name = tconnectsync
version = 2.3.0
version = 2.3.1
author = James Woglom
author_email = j@wogloms.net
description = Syncs Tandem Source (formerly t:connect) insulin pump data to Nightscout for the t:slim X2
+1 -1
View File
@@ -119,7 +119,7 @@ def main(*args, **kwargs):
if args.auto_update:
u = TandemSourceAutoupdate(secret)
sys.exit(u.process(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features))
sys.exit(u.process(tconnect, nightscout, args.pretend, features=args.features))
else:
tconnectDevice = TandemSourceChooseDevice(secret, tconnect).choose()
added, last_event_id = TandemSourceProcessTimeRange(tconnect, nightscout, tconnectDevice, pretend=args.pretend, secret=secret, features=args.features).process(time_start, time_end)
+4 -1
View File
@@ -27,7 +27,7 @@ class TandemSourceAutoupdate:
until stopped (ctrl+c), or a maximum of AUTOUPDATE_MAX_LOOP_INVOCATIONS times.
Stops if AUTOUPDATE_RESTART_ON_FAILURE is set and an error occurs.
"""
def process(self, tconnect, nightscout, time_start, time_end, pretend, features=None):
def process(self, tconnect, nightscout, pretend, features=None):
if features is None:
features = DEFAULT_FEATURES
@@ -40,6 +40,9 @@ class TandemSourceAutoupdate:
logger.debug("autoupdate loop")
now = time.time()
time_end = datetime.datetime.now()
time_start = time_end - datetime.timedelta(days=1)
tconnectDevice = ChooseDevice(self.secret, tconnect).choose()
event_seqnum = None