tconnectsync 2.3.0__tar.gz → 2.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tconnectsync-2.3.0/tconnectsync.egg-info → tconnectsync-2.3.4}/PKG-INFO +1 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/setup.cfg +1 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/__init__.py +1 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/raw_event.py +1 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/autoupdate.py +4 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process.py +6 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cgm_reading.py +4 -2
- {tconnectsync-2.3.0 → tconnectsync-2.3.4/tconnectsync.egg-info}/PKG-INFO +1 -1
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/LICENSE.md +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/README.md +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/pyproject.toml +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/setup.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/__main__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/android.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/common.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/controliq.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/tandemsource.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/webui.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/api/ws2.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/check.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/bolus.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/device_settings.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/tandemsource/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/tandemsource/event_class.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/tandemsource/pump_settings.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/therapy_event.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/domain/utility.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/build_events.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/events.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/generic.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/static_dicts.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/transforms.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/eventparser/utils.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/features.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/nightscout.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/parser/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/parser/ciq_therapy_events.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/parser/nightscout.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/parser/tconnect.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/process.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/secret.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/choose_device.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/cli_helpers.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/helpers.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/heroku_helpers.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_alarm.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_basal.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_basal_resume.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_basal_suspension.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_bolus.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cartridge.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cgm_alert.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cgm_start_join_stop.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_device_status.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_user_mode.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/update_profiles.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/util/__init__.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/util/cli.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/util/constants.py +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync.egg-info/SOURCES.txt +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync.egg-info/dependency_links.txt +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync.egg-info/entry_points.txt +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync.egg-info/requires.txt +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync.egg-info/top_level.txt +0 -0
- {tconnectsync-2.3.0 → tconnectsync-2.3.4}/tests/test_secret.py +0 -0
|
@@ -119,7 +119,7 @@ def main(*args, **kwargs):
|
|
|
119
119
|
|
|
120
120
|
if args.auto_update:
|
|
121
121
|
u = TandemSourceAutoupdate(secret)
|
|
122
|
-
sys.exit(u.process(tconnect, nightscout,
|
|
122
|
+
sys.exit(u.process(tconnect, nightscout, args.pretend, features=args.features))
|
|
123
123
|
else:
|
|
124
124
|
tconnectDevice = TandemSourceChooseDevice(secret, tconnect).choose()
|
|
125
125
|
added, last_event_id = TandemSourceProcessTimeRange(tconnect, nightscout, tconnectDevice, pretend=args.pretend, secret=secret, features=args.features).process(time_start, time_end)
|
|
@@ -27,7 +27,7 @@ class TandemSourceAutoupdate:
|
|
|
27
27
|
until stopped (ctrl+c), or a maximum of AUTOUPDATE_MAX_LOOP_INVOCATIONS times.
|
|
28
28
|
Stops if AUTOUPDATE_RESTART_ON_FAILURE is set and an error occurs.
|
|
29
29
|
"""
|
|
30
|
-
def process(self, tconnect, nightscout,
|
|
30
|
+
def process(self, tconnect, nightscout, pretend, features=None):
|
|
31
31
|
if features is None:
|
|
32
32
|
features = DEFAULT_FEATURES
|
|
33
33
|
|
|
@@ -40,6 +40,9 @@ class TandemSourceAutoupdate:
|
|
|
40
40
|
logger.debug("autoupdate loop")
|
|
41
41
|
now = time.time()
|
|
42
42
|
|
|
43
|
+
time_end = datetime.datetime.now()
|
|
44
|
+
time_start = time_end - datetime.timedelta(days=1)
|
|
45
|
+
|
|
43
46
|
tconnectDevice = ChooseDevice(self.secret, tconnect).choose()
|
|
44
47
|
|
|
45
48
|
event_seqnum = None
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import collections
|
|
3
|
+
import arrow
|
|
3
4
|
|
|
4
5
|
from ...features import DEVICE_STATUS, DEFAULT_FEATURES
|
|
5
6
|
from ...eventparser import events as eventtypes
|
|
@@ -81,7 +82,11 @@ class ProcessTimeRange:
|
|
|
81
82
|
c = self.event_classes[clazz](self.tconnect, self.nightscout, self.tconnect_device_id, self.pretend, self.features)
|
|
82
83
|
if c.enabled():
|
|
83
84
|
logger.info("%s is enabled from features %s" % (clazz, self.features))
|
|
84
|
-
|
|
85
|
+
# Cap events_last_time at time_end to handle pump clock drift
|
|
86
|
+
# Ensure time_end is timezone-aware for comparison
|
|
87
|
+
time_end_aware = arrow.get(time_end)
|
|
88
|
+
capped_time_end = min(events_last_time, time_end_aware) if events_last_time else time_end_aware
|
|
89
|
+
ns_entries = c.process(events, events_first_time, capped_time_end)
|
|
85
90
|
w = c.write(ns_entries)
|
|
86
91
|
if w:
|
|
87
92
|
processed_count += w
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cgm_reading.py
RENAMED
|
@@ -3,6 +3,7 @@ import arrow
|
|
|
3
3
|
|
|
4
4
|
from ...features import DEFAULT_FEATURES
|
|
5
5
|
from ... import features
|
|
6
|
+
from ... import secret
|
|
6
7
|
from ...eventparser.generic import Events, decode_raw_events, EVENT_LEN
|
|
7
8
|
from ...eventparser.utils import bitmask_to_list
|
|
8
9
|
from ...eventparser.raw_event import TANDEM_EPOCH
|
|
@@ -16,12 +17,13 @@ from ...parser.nightscout import (
|
|
|
16
17
|
logger = logging.getLogger(__name__)
|
|
17
18
|
|
|
18
19
|
class ProcessCGMReading:
|
|
19
|
-
def __init__(self, tconnect, nightscout, tconnect_device_id, pretend, features=DEFAULT_FEATURES):
|
|
20
|
+
def __init__(self, tconnect, nightscout, tconnect_device_id, pretend, features=DEFAULT_FEATURES, timezone=None):
|
|
20
21
|
self.tconnect = tconnect
|
|
21
22
|
self.nightscout = nightscout
|
|
22
23
|
self.tconnect_device_id = tconnect_device_id
|
|
23
24
|
self.pretend = pretend
|
|
24
25
|
self.features = features
|
|
26
|
+
self.timezone = timezone or secret.TIMEZONE_NAME
|
|
25
27
|
|
|
26
28
|
def enabled(self):
|
|
27
29
|
return features.CGM in self.features
|
|
@@ -66,7 +68,7 @@ class ProcessCGMReading:
|
|
|
66
68
|
def timestamp_for(self, event):
|
|
67
69
|
# For backfills the time the event was added to the pump's event store
|
|
68
70
|
# might not be the time it actually occurred, so we use the egvTimestamp
|
|
69
|
-
return arrow.get(TANDEM_EPOCH + event.egvTimestamp)
|
|
71
|
+
return arrow.get(TANDEM_EPOCH + event.egvTimestamp, tzinfo='UTC').replace(tzinfo=self.timezone)
|
|
70
72
|
|
|
71
73
|
def to_nsentry(self, event):
|
|
72
74
|
return NightscoutEntry.entry(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_basal_resume.py
RENAMED
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_basal_suspension.py
RENAMED
|
File without changes
|
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cartridge.py
RENAMED
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_cgm_alert.py
RENAMED
|
File without changes
|
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_device_status.py
RENAMED
|
File without changes
|
{tconnectsync-2.3.0 → tconnectsync-2.3.4}/tconnectsync/sync/tandemsource/process_user_mode.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|