Compare commits

..
4 Commits
Author SHA1 Message Date
James Woglom 0609a46ed2 v2.1.1 2024-10-02 22:23:39 -04:00
James Woglom e63d725c2b process_user_mode: fix bug when exercise concludes 2024-10-02 22:23:24 -04:00
James Woglom fec964e767 v2.1.0 2024-10-02 02:14:28 -04:00
James Woglom 366182f65b fix timezone transformation logic 2024-10-02 02:14:01 -04:00
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[metadata]
name = tconnectsync
version = 2.0.9
version = 2.1.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
@@ -38,4 +38,4 @@ class RawEvent:
# but represent the user's time zone setting. So we keep the time
# referenced on them, but force the timezone to what the user
# requests via the TZ secret.
return arrow.get(TANDEM_EPOCH + self.timestampRaw, tzinfo=TIMEZONE_NAME)
return arrow.get(TANDEM_EPOCH + self.timestampRaw, tzinfo='UTC').replace(tzinfo=TIMEZONE_NAME)
+1
View File
@@ -54,6 +54,7 @@ if not get('NS_SECRET') and get('API_SECRET'):
NS_SKIP_TLS_VERIFY = get_bool('NS_SKIP_TLS_VERIFY', 'false')
NS_IGNORE_CONN_ERRORS = get_bool('NS_IGNORE_CONN_ERRORS', 'false')
# This should be the timezone your pump is set to.
TIMEZONE_NAME = get('TIMEZONE_NAME', 'America/New_York')
if not get('TIMEZONE_NAME') and get('TZ'):
@@ -198,7 +198,7 @@ class ProcessUserMode:
if start.exercisechoice == eventtypes.LidAaUserModeChange.ExercisechoiceEnum.Timed:
reason = "Exercise (Timed)"
duration_mins = (time_end.eventTimestamp - start.eventTimestamp).seconds / 60
duration_mins = (time_end - start.eventTimestamp).seconds / 60
return NightscoutEntry.activity(
created_at=start.eventTimestamp.format(),
reason=reason + " - " + NOT_ENDED,