James Woglom
d568a5be85
Update US Tandem Source OIDC client_id
...
The Tandem Source web app now authenticates with client_id
0oa4wnbvtladeyVZX4h7 (US); the old 0oa27ho9tpZE9Arjy4h7 no longer
appears in the current build. This value is used both for the OIDC
authorize/token requests and the id_token audience check, which stay
consistent. EU client_id left unchanged (no EU capture to verify).
2026-07-01 00:59:14 +00:00
James Woglom
654ee7ead3
Update DEFAULT_EVENT_IDS to the live 55-ID pump-logs list
...
Match the Tandem Source web app's getLogIDList() as observed in the live
GET api/reports/bff/pump-logs request (from the captured HAR). Adds the
FSL3 event ids 477 (join), 480 (data), 486 (stop); reorders to match the
frontend. No removals (was 52 ids, now 55).
2026-07-01 00:53:11 +00:00
James Woglom
9619174958
CI: run on dev branch (replaces develop)
...
The develop branch was replaced by dev, so point the push/pull_request
triggers at dev instead of the now-removed develop branch.
2026-07-01 00:27:19 +00:00
James Woglom
a9c9a7ebd9
Add type annotations to TandemSource sync processors
...
Annotate the 11 event processors, the ProcessTimeRange orchestrator, and
UpdateProfiles. The shared processor interface is now typed:
__init__(tconnect, nightscout, tconnect_device_id, pretend, features),
enabled() -> bool, process(events, time_start, time_end) -> List[dict],
write(ns_entries) -> int. Converter helpers return Optional[dict] since
they fall through to None on type mismatch.
ProcessTimeRange.process() returns Tuple[int, Optional[int]] and its
tconnectDevice param reuses the PumpEventMetadata TypedDict. Client
params (TConnectApi/NightscoutApi/BaseEvent) use TYPE_CHECKING-guarded
imports with string forward refs to avoid import cycles at runtime.
2026-06-30 23:29:17 +00:00
James Woglom
8fd9bfcf72
Add type annotations to NightscoutApi
...
Annotate NightscoutApi methods and the module-level date helpers. Adds a
DateLike alias (str | datetime | arrow.Arrow) for the timestamp/filter
params. Writers return None; the last_uploaded_* getters return
Optional[dict]; api_status/current_profile return dict.
Response shapes are kept as loose dict/Optional[dict] rather than
TypedDicts since the Nightscout API shape varies across versions; only
inputs (which we control) are tightly typed.
2026-06-30 23:20:35 +00:00
James Woglom
000bae38b6
Add precise type annotations to TandemSourceApi
...
Annotate method signatures and dynamic JSON response types. Adds
TypedDicts for the responses whose shapes are confirmed from call sites
and logs:
- PumpEventMetadata (+ nested LastUpload) for pump_event_metadata()
- JwtClaims for the decoded id_token stored on jwtData; pumperId and
accountId are UUID strings, not ints
pump_events_raw() returns a base64 str (not Any). pumper_info() stays
Any since it has no callers and its shape is never logged. TypedDict is
imported with a typing_extensions fallback for Python 3.7.
2026-06-30 23:14:06 +00:00
James Woglom
e5195b2613
Fix WAF 403 by sending same-origin Origin/Referer to Source API
...
api_headers() hardcoded Origin/Referer to tconnect.tandemdiabetes.com,
but requests target SOURCE_URL (source.tandemdiabetes.com /
source.eu.tandemdiabetes.com). The WAF enforces same-origin and
returned HTTP 403 ("The request is blocked"). Derive Origin/Referer
from SOURCE_URL so both US and EU regions match.
2026-06-30 22:56:26 +00:00
James Woglom
d78d70adf5
fix #136
2026-03-26 03:56:47 -04:00
James Woglom
8381e50fe6
fix duplicate enum keys
2026-03-15 13:53:03 -04:00
James Woglom
93b0901aae
Update events.json blob
2026-03-15 13:35:43 -04:00
James Woglom
b1f63f8858
v2.3.5
2026-03-05 19:22:32 -05:00
James Woglom
9878e83755
exclude venv from flake8
2026-03-05 19:17:12 -05:00
James Woglom
d8b57fe788
remove duplicate pipfile definitions also in setup.cfg, fix actions
2026-03-05 19:13:21 -05:00
James Woglom
664f97be35
pin pyjwt in setup.cfg
2026-03-05 18:54:08 -05:00
James Woglom
9094976085
update for py3.8
2026-03-05 18:50:11 -05:00
James Woglom
b592f6b464
ci 3.8: PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process
2026-03-05 03:00:20 -05:00
James Woglom
4f2affe70f
switch from pkg_resources to importlib_metadata
2026-03-05 02:54:45 -05:00
James Woglom
0733531f67
add setuptools dep
2026-03-05 02:50:33 -05:00
James Woglom
68dcb25911
v2.3.4
2025-12-14 23:59:06 -05:00
James Woglom
795361c6ad
timezone tests
2025-12-14 23:58:35 -05:00
James Woglom
c9190df50a
timestamp override in tests
2025-12-14 23:56:30 -05:00
James Woglom
15160537f5
add process_cgm_reading tests
2025-12-14 23:52:55 -05:00
James Woglom
aea3f6bd6b
v2.3.3
2025-11-23 00:03:34 -05:00
James Woglom
2bf40cac28
fix TypeError: can't compare offset-naive and offset-aware datetimes
2025-11-23 00:03:16 -05:00
James Woglom
73dabe5ead
v2.3.2
2025-11-18 14:01:18 -05:00
James Woglom
e848a8482d
add new process test for tz change
2025-11-18 14:00:54 -05:00
James Woglom
9c06efb045
when pump TZ changes moves date into the future, do not add "current" basal to extend to that timestamp
2025-11-18 13:59:17 -05:00
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
James Woglom
4837ac1e86
v2.3.0
2025-06-07 23:34:42 -04:00
James Woglom
8b15ec5c90
add test_profile_data
2025-06-07 23:31:10 -04:00
James Woglom
37b008f6c3
fix test path
2025-06-07 23:29:09 -04:00
James Woglom
8c40fdb533
fix test import
2025-06-07 23:27:42 -04:00
James Woglom
d51080f6d0
Fix profile test
2025-06-07 23:24:41 -04:00
James Woglom
b32415aaac
Delete dead non-tandem source tests
2025-06-07 23:21:38 -04:00
James Woglom
ffd3c5b1ea
Delete dead non-tandem source code
2025-06-07 23:21:18 -04:00
James Woglom
0b4674bae9
update check script
2025-06-07 23:19:23 -04:00
James Woglom
a1202decbe
ignore name never assigned in scope flake8
2025-06-07 22:53:18 -04:00
James Woglom
803b15b886
v2.2.4
2025-05-06 13:14:01 -04:00
James Woglom
f5cd7c0151
v2.2.3
2025-03-29 23:37:15 -04:00
James Woglom
13bb106924
defaults: failure time to 75 min, turn off auto restart on failure
2025-03-29 23:36:53 -04:00
James Woglom
fd96b08aab
stop running pipenv check
2025-01-15 19:14:20 -05:00
James Woglom
4a8da39b44
process: automatically fetch all event types for devicestatus feature
2025-01-15 18:56:36 -05:00
James Woglom
7a0f9477f2
eventparser: add todict function on all event classes
2025-01-15 18:56:08 -05:00
James Woglom
934d90e3b9
log found ProcessDeviceStatus
2025-01-02 20:05:31 -05:00
James Woglom
ea84b0b9cc
v2.2.2
2024-12-30 22:05:22 -05:00
James Woglom
07aaea9e1c
fix tests
2024-12-30 22:05:11 -05:00
James Woglom
67b9f42f9b
v2.2.1
2024-12-30 22:02:54 -05:00
James Woglom
997ab7bac8
attempt to fix batteryChargePercent
2024-12-30 22:02:36 -05:00
James Woglom
b1f8263ceb
v2.2.0
2024-12-13 19:47:29 -05:00
James Woglom
29d08a7f1b
fix non-autoupdate
2024-12-13 19:47:01 -05:00
James Woglom
c7ade49eea
devicestatus: tune nightscout output to look more like Loops uploader
2024-12-13 02:09:36 -05:00
James Woglom
1f0fbd7788
less noisy logs in update profiles
2024-12-13 01:42:58 -05:00
James Woglom
4bda0a21f2
more explicit logging for last update seen
2024-12-13 01:41:16 -05:00
James Woglom
d1341e09c0
devicestatus: set pump.battery.percent
2024-12-12 22:20:13 -05:00
James Woglom
fb9588ff2c
catch iso8601 date errors
2024-12-12 00:41:51 -05:00
James Woglom
2339b4543e
v2.1.9
2024-12-12 00:36:16 -05:00
James Woglom
3f6010fafc
add processdevicestatus
2024-12-12 00:36:06 -05:00
James Woglom
a028cdf3fe
v2.1.8
2024-12-12 00:29:19 -05:00
James Woglom
093b42ff94
fix codecov
2024-12-12 00:29:11 -05:00
James Woglom
00023c6aba
fix flake8
2024-12-12 00:27:35 -05:00
James Woglom
1ed3d35965
v2.1.7
2024-12-12 00:23:45 -05:00
James Woglom
9493b6546f
process_alarm exclude resumepumpalarm and test
2024-12-12 00:23:17 -05:00
James Woglom
24a635ca21
add process_device_status and process_user_mode tests
2024-12-12 00:09:28 -05:00
James Woglom
80824906d9
add unit test
2024-12-11 22:41:58 -05:00
James Woglom
e5259a7981
attempt to mutate battery charge percent
2024-12-11 00:56:01 -05:00
James Woglom
650fb60988
support excluding event id filter
2024-12-11 00:50:40 -05:00
James Woglom
2b367d45f3
eventparser: use eventID consistently as seqNum
2024-12-10 20:35:17 -05:00
James Woglom
dd2dcd17bd
eventparser: add custom events
2024-12-10 17:48:51 -05:00
James Woglom
98b7edc904
eventparser: handle unknown ids in Event()
2024-12-10 17:44:54 -05:00
James Woglom
e82d311fd6
eventparser: move baseevent
2024-12-10 17:44:32 -05:00
James Woglom
9a2a4ca771
v2.1.6
2024-10-16 21:34:22 -04:00
James Woglom
54ba2ed7df
profiles: sort and set enteredBy
2024-10-16 21:34:11 -04:00
James Woglom
2892eb8ace
exclude empty pump profile segments
2024-10-16 21:13:41 -04:00
James Woglom
1d432982ad
v2.1.5 with pypi upload fix
2024-10-07 21:59:01 -04:00
James Woglom
891c2e2c10
fix printf
2024-10-07 21:30:50 -04:00
James Woglom
7dc479c84b
v2.1.4
2024-10-05 12:56:17 -04:00
James Woglom
0417fb9fd8
add IGNORE_ZERO_UNIT_BASAL
2024-10-05 12:55:59 -04:00
James Woglom
b80d52662b
v2.1.3
2024-10-03 01:00:16 -04:00
James Woglom
81b13f236a
v2.1.2
2024-10-02 23:07:43 -04:00
James Woglom
d57b3872f1
fix process_user_mode again
2024-10-02 23:07:34 -04:00
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
James Woglom
d9d09dddb3
v2.0.9
2024-10-02 01:35:10 -04:00
James Woglom
04643255fe
heroku_helpers
2024-10-02 01:34:47 -04:00
James Woglom
c2f7070f3b
no 3.7 build job
2024-10-02 00:56:38 -04:00
James Woglom
9c35f850b9
v2.0.8
2024-10-02 00:54:29 -04:00
James Woglom
a7383b0796
fix return code
2024-10-02 00:52:41 -04:00
James Woglom
4f52927d2f
try to fix jwt import error
2024-10-02 00:45:39 -04:00
James Woglom
5b938c010d
only conditionally import typing_extensions
2024-10-02 00:39:56 -04:00
James Woglom
3e50c7018d
py3.7 force pyopenssl
2024-10-01 21:02:04 -04:00
James Woglom
32f3639eb0
py3.7 actions
2024-10-01 17:29:49 -04:00
James Woglom
9a7cb1bdfd
no anchors
2024-10-01 17:27:01 -04:00
James Woglom
ead7ab883b
check old python versions
2024-10-01 17:25:26 -04:00
James Woglom
ff395ffa3e
test on py3.7
2024-10-01 17:17:55 -04:00
James Woglom
8f2ad586fd
v2.0.7: fix py3.7 compat
2024-10-01 17:17:33 -04:00
James Woglom
828cccaf10
v2.0.6: update install_requires packages
2024-10-01 17:05:54 -04:00
James Woglom
ae26102df2
v2.0.5
2024-10-01 17:01:40 -04:00