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.
This commit is contained in:
James Woglom
2026-07-01 02:34:19 +00:00
parent c5854ac17c
commit 02e3910928
2 changed files with 12 additions and 1 deletions
+6 -1
View File
@@ -609,7 +609,12 @@ class TandemSourceApi:
endpoint GET api/reports/bff/pump-logs/{device_id}. device_id is the endpoint GET api/reports/bff/pump-logs/{device_id}. device_id is the
UUID assignmentId (PumpMetadata.deviceId). Returns {events, clockChanges}. UUID assignmentId (PumpMetadata.deviceId). Returns {events, clockChanges}.
The server caps the window at ~4 weeks; callers needing a longer range 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) minDate = parse_ymd_date(min_date)
maxDate = parse_ymd_date(max_date) maxDate = parse_ymd_date(max_date)
logger.debug(f'get_pump_logs({device_id}, {minDate}, {maxDate})') logger.debug(f'get_pump_logs({device_id}, {minDate}, {maxDate})')
@@ -64,6 +64,12 @@ class ProcessDeviceStatus:
return [entry] return [entry]
def daily_basal_to_nsentry(self, event: "BaseEvent") -> Optional[dict]: 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 # 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 # event arrived without them (an event shape we can't yet parse), skip
# it rather than raise on the arithmetic below. # it rather than raise on the arithmetic below.