tconnectsync 0.9.4__tar.gz → 0.9.7__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.
Files changed (47) hide show
  1. {tconnectsync-0.9.4/tconnectsync.egg-info → tconnectsync-0.9.7}/PKG-INFO +7 -2
  2. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/README.md +1 -1
  3. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/setup.cfg +1 -1
  4. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/controliq.py +1 -1
  5. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/webui.py +5 -1
  6. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/pump_events.py +3 -3
  7. {tconnectsync-0.9.4 → tconnectsync-0.9.7/tconnectsync.egg-info}/PKG-INFO +7 -2
  8. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/LICENSE.md +0 -0
  9. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/pyproject.toml +0 -0
  10. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/setup.py +0 -0
  11. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/__init__.py +0 -0
  12. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/__init__.py +0 -0
  13. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/android.py +0 -0
  14. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/common.py +0 -0
  15. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/api/ws2.py +0 -0
  16. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/autoupdate.py +0 -0
  17. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/check.py +0 -0
  18. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/domain/__init__.py +0 -0
  19. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/domain/bolus.py +0 -0
  20. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/domain/device_settings.py +0 -0
  21. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/domain/therapy_event.py +0 -0
  22. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/domain/utility.py +0 -0
  23. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/features.py +0 -0
  24. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/nightscout.py +0 -0
  25. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/parser/__init__.py +0 -0
  26. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/parser/ciq_therapy_events.py +0 -0
  27. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/parser/nightscout.py +0 -0
  28. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/parser/tconnect.py +0 -0
  29. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/process.py +0 -0
  30. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/secret.py +0 -0
  31. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/__init__.py +0 -0
  32. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/basal.py +0 -0
  33. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/bolus.py +0 -0
  34. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/cgm.py +0 -0
  35. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/iob.py +0 -0
  36. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/sync/profile.py +0 -0
  37. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/util/__init__.py +0 -0
  38. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/util/cli.py +0 -0
  39. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync/util/constants.py +0 -0
  40. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync.egg-info/SOURCES.txt +0 -0
  41. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync.egg-info/dependency_links.txt +0 -0
  42. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync.egg-info/entry_points.txt +0 -0
  43. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync.egg-info/requires.txt +0 -0
  44. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tconnectsync.egg-info/top_level.txt +0 -0
  45. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tests/test_autoupdate.py +0 -0
  46. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tests/test_process.py +0 -0
  47. {tconnectsync-0.9.4 → tconnectsync-0.9.7}/tests/test_secret.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tconnectsync
3
- Version: 0.9.4
3
+ Version: 0.9.7
4
4
  Summary: Syncs Tandem t:connect pump data to Nightscout for the t:slim X2
5
5
  Home-page: https://github.com/jwoglom/tconnectsync
6
6
  Author: James Woglom
@@ -12,6 +12,11 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.7
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.md
15
+ Requires-Dist: requests
16
+ Requires-Dist: bs4
17
+ Requires-Dist: arrow
18
+ Requires-Dist: lxml
19
+ Requires-Dist: python-dotenv
15
20
 
16
21
  # tconnectsync
17
22
 
@@ -70,7 +75,7 @@ The following synchronization features can be optionally enabled:
70
75
  * Sleep Mode (in Nightscout, appears with a start and end time)
71
76
  * `IOB`: Insulin-on-board data. Only the most recent IOB entry is saved to Nightscout, as an "activity". The Nightscout UI does not currently display this information. In order to read this value, you need to query the Nightscout activity API endpoint. If you don't know what that means, then there is no reason to enable this option.
72
77
 
73
- The following synchronization features are under development, [**but are not yet ready for use**](https://github.com/jwoglom/tconnectsync/issues/16):
78
+ The following synchronization features are considered to be in alpha, and haven't been widely tested. If you want to use them, [set `ENABLE_TESTING_MODES=true` for them to show up](https://github.com/jwoglom/tconnectsync/blob/master/tconnectsync/features.py#L29):
74
79
  * `BOLUS_BG`: Adds BG readings which are associated with boluses on the pump into the Nightscout treatment object. It will determine whether the BG reading was automatically filled via the Dexcom connection on the pump or was manually entered by seeing if the BG reading matches the current CGM reading as known to the pump at that time. Support for this is nearly complete.
75
80
  * `CGM`: Adds Dexcom CGM readings from the pump to Nightscout as SGV (sensor glucose value) entries. This should only be used in a situation where xDrip/Dexcom Share/etc. is not used and the pump connection to the CGM will be the only source of CGM data to Nightscout. This requires additional testing before it should be considered ready.
76
81
 
@@ -55,7 +55,7 @@ The following synchronization features can be optionally enabled:
55
55
  * Sleep Mode (in Nightscout, appears with a start and end time)
56
56
  * `IOB`: Insulin-on-board data. Only the most recent IOB entry is saved to Nightscout, as an "activity". The Nightscout UI does not currently display this information. In order to read this value, you need to query the Nightscout activity API endpoint. If you don't know what that means, then there is no reason to enable this option.
57
57
 
58
- The following synchronization features are under development, [**but are not yet ready for use**](https://github.com/jwoglom/tconnectsync/issues/16):
58
+ The following synchronization features are considered to be in alpha, and haven't been widely tested. If you want to use them, [set `ENABLE_TESTING_MODES=true` for them to show up](https://github.com/jwoglom/tconnectsync/blob/master/tconnectsync/features.py#L29):
59
59
  * `BOLUS_BG`: Adds BG readings which are associated with boluses on the pump into the Nightscout treatment object. It will determine whether the BG reading was automatically filled via the Dexcom connection on the pump or was manually entered by seeing if the BG reading matches the current CGM reading as known to the pump at that time. Support for this is nearly complete.
60
60
  * `CGM`: Adds Dexcom CGM readings from the pump to Nightscout as SGV (sensor glucose value) entries. This should only be used in a situation where xDrip/Dexcom Share/etc. is not used and the pump connection to the CGM will be the only source of CGM data to Nightscout. This requires additional testing before it should be considered ready.
61
61
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = tconnectsync
3
- version = 0.9.4
3
+ version = 0.9.7
4
4
  author = James Woglom
5
5
  author_email = j@wogloms.net
6
6
  description = Syncs Tandem t:connect pump data to Nightscout for the t:slim X2
@@ -14,7 +14,7 @@ class ControlIQApi:
14
14
  BASE_URL = 'https://tdcservices.tandemdiabetes.com/'
15
15
  LOGIN_URL = 'https://tconnect.tandemdiabetes.com/login.aspx?ReturnUrl=%2f'
16
16
 
17
- LAST_CONFIRMED_SOFTWARE_VERSION = 't:connect 7.15.0.1'
17
+ LAST_CONFIRMED_SOFTWARE_VERSION = 't:connect 7.16.0.1'
18
18
 
19
19
  userGuid = None
20
20
  accessToken = None
@@ -30,10 +30,14 @@ class WebUIScraper:
30
30
  return self.controliq.needs_relogin()
31
31
 
32
32
  def _get(self, endpoint):
33
- r = self.controliq.loginSession.get(self.BASE_URL + endpoint, headers=base_headers())
33
+ r = self.controliq.loginSession.get(self.BASE_URL + endpoint, headers=base_headers(), allow_redirects=True)
34
34
 
35
35
  if r.status_code != 200:
36
36
  raise ApiException(r.status_code, "WebUIScraper HTTP %s response: %s" % (str(r.status_code), r.text))
37
+
38
+ if 'login.aspx' in r.url:
39
+ raise ApiException(401, "WebUIScraper HTTP %s response for login page, returning 401: %s" % (str(r.status_code), r.url))
40
+
37
41
  return r
38
42
 
39
43
 
@@ -192,11 +192,11 @@ def _ns_write_pump_events(nightscout, events, buildNsEventFunc, eventType, prete
192
192
 
193
193
  add_count = 0
194
194
  for event in events:
195
- created_at = event["time"]
196
- if last_upload_time and arrow.get(created_at) <= last_upload_time:
195
+ created_at = arrow.get(event["time"])
196
+ if last_upload_time and created_at <= last_upload_time:
197
197
  skip = True
198
198
  if "duration_mins" in event.keys() and "duration" in last_upload.keys():
199
- if created_at == last_upload["created_at"] and float(event["duration_mins"]) > float(last_upload["duration"]):
199
+ if created_at == arrow.get(last_upload["created_at"]) and float(event["duration_mins"]) > float(last_upload["duration"]):
200
200
  logger.info("Latest %s event needs updating: duration has increased from %s to %s: %s" % (eventType, last_upload["duration"], event["duration_mins"], event))
201
201
  logger.info("Deleting previous %s: %s" % (eventType, last_upload))
202
202
  nightscout.delete_entry('treatments/%s' % last_upload["_id"])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tconnectsync
3
- Version: 0.9.4
3
+ Version: 0.9.7
4
4
  Summary: Syncs Tandem t:connect pump data to Nightscout for the t:slim X2
5
5
  Home-page: https://github.com/jwoglom/tconnectsync
6
6
  Author: James Woglom
@@ -12,6 +12,11 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.7
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE.md
15
+ Requires-Dist: requests
16
+ Requires-Dist: bs4
17
+ Requires-Dist: arrow
18
+ Requires-Dist: lxml
19
+ Requires-Dist: python-dotenv
15
20
 
16
21
  # tconnectsync
17
22
 
@@ -70,7 +75,7 @@ The following synchronization features can be optionally enabled:
70
75
  * Sleep Mode (in Nightscout, appears with a start and end time)
71
76
  * `IOB`: Insulin-on-board data. Only the most recent IOB entry is saved to Nightscout, as an "activity". The Nightscout UI does not currently display this information. In order to read this value, you need to query the Nightscout activity API endpoint. If you don't know what that means, then there is no reason to enable this option.
72
77
 
73
- The following synchronization features are under development, [**but are not yet ready for use**](https://github.com/jwoglom/tconnectsync/issues/16):
78
+ The following synchronization features are considered to be in alpha, and haven't been widely tested. If you want to use them, [set `ENABLE_TESTING_MODES=true` for them to show up](https://github.com/jwoglom/tconnectsync/blob/master/tconnectsync/features.py#L29):
74
79
  * `BOLUS_BG`: Adds BG readings which are associated with boluses on the pump into the Nightscout treatment object. It will determine whether the BG reading was automatically filled via the Dexcom connection on the pump or was manually entered by seeing if the BG reading matches the current CGM reading as known to the pump at that time. Support for this is nearly complete.
75
80
  * `CGM`: Adds Dexcom CGM readings from the pump to Nightscout as SGV (sensor glucose value) entries. This should only be used in a situation where xDrip/Dexcom Share/etc. is not used and the pump connection to the CGM will be the only source of CGM data to Nightscout. This requires additional testing before it should be considered ready.
76
81
 
File without changes
File without changes