From 02e39109289c520b11ba23e2cd2a30e4f14bcd64 Mon Sep 17 00:00:00 2001 From: James Woglom Date: Wed, 1 Jul 2026 02:34:19 +0000 Subject: [PATCH] Document that the new API drops DEVICE_STATUS and ignores eventIds Live probes against t:slim X2 and Mobi accounts confirm the pump-logs endpoint never returns event 81 (LID_DAILY_BASAL) and no returned event carries battery data, so DEVICE_STATUS yields nothing on the new API (it degrades gracefully). The endpoint also ignores the eventIds filter and returns every event in the window; filtering is effectively client-side. --- tconnectsync/api/tandemsource.py | 7 ++++++- tconnectsync/sync/tandemsource/process_device_status.py | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tconnectsync/api/tandemsource.py b/tconnectsync/api/tandemsource.py index 01f7c33..15cea0d 100644 --- a/tconnectsync/api/tandemsource.py +++ b/tconnectsync/api/tandemsource.py @@ -609,7 +609,12 @@ class TandemSourceApi: endpoint GET api/reports/bff/pump-logs/{device_id}. device_id is the UUID assignmentId (PumpMetadata.deviceId). Returns {events, clockChanges}. The server caps the window at ~4 weeks; callers needing a longer range - must page by date window (see pump_events).""" + must page by date window (see pump_events). + + Note: the server currently ignores eventIds and returns every event in + the window regardless of the filter (verified against live accounts), so + the effective filtering happens client-side via EventClass dispatch. We + still send eventIds to mirror the web app and stay forward-compatible.""" minDate = parse_ymd_date(min_date) maxDate = parse_ymd_date(max_date) logger.debug(f'get_pump_logs({device_id}, {minDate}, {maxDate})') diff --git a/tconnectsync/sync/tandemsource/process_device_status.py b/tconnectsync/sync/tandemsource/process_device_status.py index bb3cd33..4b70c8c 100644 --- a/tconnectsync/sync/tandemsource/process_device_status.py +++ b/tconnectsync/sync/tandemsource/process_device_status.py @@ -64,6 +64,12 @@ class ProcessDeviceStatus: return [entry] def daily_basal_to_nsentry(self, event: "BaseEvent") -> Optional[dict]: + # NOTE: the pump-logs endpoint does not emit event 81 (LID_DAILY_BASAL) + # for either t:slim X2 or Mobi (verified against live accounts), and no + # other returned event carries battery data. DEVICE_STATUS therefore + # yields nothing on the new API; this path stays for the binary decoder + # and in case the endpoint starts returning event 81. + # # The battery percent is derived from the msb/lsb raw fields; if the # event arrived without them (an event shape we can't yet parse), skip # it rather than raise on the arithmetic below.