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
Beshoy Girgis and James Woglom
f0f94baf02
revert nightscout.py
2026-03-27 11:08:23 -07:00
Beshoy Girgis and James Woglom
bf894bce02
Add script to update events.json from minified url
2026-03-27 11:08:23 -07:00
Beshoy Girgis and James Woglom
594ee19450
Add Freestyle Libre 3 (FSL3) CGM sensor support
...
Implement FSL3 sensor integration alongside G6, G7, and FSL2 with expanded
CGM alert codes, improved datetime handling, and test coverage.
**FSL3 Event Integration:**
- Add FSL3 events to CGM_READING, _CGM_JOIN, and _CGM_STOP event classes
- Enable unified processing of FSL3 alongside existing sensor variants:
- Event 480: LID_CGM_DATA_FSL3
- Event 477: LID_CGM_JOIN_SESSION_FSL3
- Event 486: LID_CGM_STOP_SESSION_FSL3
**CGM Alert Enumeration:**
- Expand CGM alert codes from 8 to 18 mapped codes
- Add verified alert codes: 1, 2, 3, 8, 12, 22, 25, 45, 46, 48
- Rename alert 51 to CONTROL_IQ_LOW (was DEFAULT_ALERT_51)
- Add alert descriptions based on pump history verification
**Code Quality Improvements:**
- Fix duplicate enum keys in events.json (Sensor Type codes 12, 13)
- Add logging infrastructure to generic.py for event diagnostics
- Add conftest.py test configuration
**DateTime and API Improvements:**
- Fix format_datetime() for proper UTC conversion with Z suffix
- Simplify Nightscout API methods by removing redundant retry logic
- Improve error reporting in last_uploaded_entry() and last_uploaded_bg_entry()
**Test Coverage:**
- Add 3 FSL3 test cases with real pump data
- Test single reading processing, multiple readings, and JOIN event parsing
- All 105 tests passing (102 existing + 3 new FSL3 tests)
2026-03-27 11:08:23 -07: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
Alessio Rosi and James Woglom
82ccaa5a88
fix: upgrade Python 3.9 → 3.11 to fix missing python-dotenv
2026-03-15 02:22:10 -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
Andy Low and James Woglom
1f1e755503
Add timezone support to timestamp calculation
...
Update timestamp handling to include timezone information.
2025-12-14 23:51:35 -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
samfundev and James Woglom
5a76a4cfd1
Fix auto-update only running for 24 hours
...
Fixes #11
2025-06-08 11:06:24 -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
Adam Bovill and James Woglom
4888426034
feat: Add EU region support for Tandem t:connect API
...
Add comprehensive support for European Tandem t:connect servers alongside existing US support.
Features:
- Region parameter in TandemSourceApi (default: US, supports: US/EU)
- EU-specific API endpoints and client ID configuration
- Region-aware credential caching to prevent cross-region conflicts
- Command line --region flag and TCONNECT_REGION environment variable
- Full backward compatibility (defaults to US region)
Technical Changes:
- Separated common SSO URLs from region-specific service URLs
- Added region validation and URL property methods
- Enhanced credential cache with region isolation
- Updated CLI argument parsing and configuration system
- Added comprehensive logging for region selection
Testing:
- Verified US region backward compatibility
- Successfully tested EU authentication and data retrieval
- Processed real EU pump data (1500+ events, 39KB)
- Validated all event types: basal, bolus, CGM, user modes, alarms
- Confirmed Nightscout integration compatibility
This enables EU Tandem pump users to sync their data using:
--region EU or TCONNECT_REGION=EU
2025-06-07 22:48:43 -04:00
James Woglom
803b15b886
v2.2.4
2025-05-06 13:14:01 -04:00
Josh and James Woglom
9e78fe770f
chore: add main py for module finding in vscode
2025-05-06 13:13:19 -04:00
Josh and James Woglom
dfb39e07ef
warn: add warning if selected pump serial has no recent events
2025-05-06 13:13:19 -04:00
Josh and James Woglom
9fad0d71ef
chore: update gitignore with venv and vscode dirs
2025-05-06 13:13:19 -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
v2.2.2
2024-12-30 22:05:22 -05:00