jwoglom / tconnectsync

Syncs data from Tandem Source (formerly t:connect) to Nightscout for the t:slim X2 and Mobi insulin pumps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unknown therapy event type: Basal

HockeyTrafalgar opened this issue · comments

Hi! I'm just setting up a new pum, running tconnectsync, getting this error. Please note that the pump and the TConnect account are just being set up and there's only ±2 hours worth of data in there.

PS Thanks for the patcher app! :)

2022-12-02 14:04:00 INFO Enabled features: BASAL, BOLUS
Processing data between 2022-12-01 14:04:00.554028 and 2022-12-02 14:04:00.554028
2022-12-02 14:04:00 INFO Downloading t:connect ControlIQ data
2022-12-02 14:04:00 INFO Logging in to ControlIQApi...
2022-12-02 14:04:01 INFO Reported tconnect software version: t:connect 7.14.0.1
2022-12-02 14:04:03 INFO Logged in to ControlIQApi successfully (expiration: 2022-12-02T22:04:01.654Z, in 7 hours, 59 minutes)
2022-12-02 14:04:04 INFO Downloading t:connect therapy_events
Traceback (most recent call last):
File "/usr/local/bin/tconnectsync", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/tconnectsync/init.py", line 91, in main
added = process_time_range(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features)
File "/usr/local/lib/python3.8/dist-packages/tconnectsync/process.py", line 67, in process_time_range
ciqBolusData, ciqReadingData = split_therapy_events(ciqTherapyEventsData)
File "/usr/local/lib/python3.8/dist-packages/tconnectsync/parser/ciq_therapy_events.py", line 13, in split_therapy_events
event = TConnectEntry.parse_therapy_event(e)
File "/usr/local/lib/python3.8/dist-packages/tconnectsync/parser/tconnect.py", line 206, in parse_therapy_event
raise UnknownTherapyEventException(data)
tconnectsync.parser.tconnect.UnknownTherapyEventException: Unknown therapy event type: Basal in {'basalRate': {'duration': 0, 'percent': 0, 'value': 0.0}, 'displayInHistory': 0, 'eventDateTime': '2022-12-02T00:00:00', 'note': {'id': 0, 'indexId': '16403', 'eventTypeId': 90, 'sourceRecordId': 0, 'eventId': 0, 'active': False}, 'noteDate': {}, 'requestDateTime': '0001-01-01T00:00:00', 'type': 'Basal', 'description': 'NDE', 'sourceRecId': 194184894, 'eventTypeId': 0, 'indexId': 0, 'uploadId': 0, 'interactive': 1, 'tempRateId': 0, 'tempRateCompleted': 0, 'tempRateActivated': 0}

@TimValishev this should now be fixed on the latest version of tconnectsync (v0.8.7). Tandem seems to be continually adding new types of events which are being returned from this API. Thanks for the report!