jwoglom / tconnectsync

Syncs insulin pump data from Tandem t:connect to Nightscout for the t:slim X2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bolus not updating in NS

diabetesman opened this issue · comments

Hi,
I'm running tconnectsync v0.9.1 on Raspberry Pi. The bolus values are not getting updated in Nightscout but the basal values are.
The error is "AttributeError: 'Bolus' object has no attribute 'start_time'", see output below from manually running it.

Thanks

pi@raspberrypi:~ $ tconnectsync -v --features BASAL BOLUS
2023-01-30 09:57:27 DEBUG Set logging level to DEBUG
2023-01-30 09:57:27 INFO Enabled features: BASAL, BOLUS
Processing data between 2023-01-29 09:57:27.798637 and 2023-01-30 09:57:27.798637
2023-01-30 09:57:27 INFO Downloading t:connect ControlIQ data
2023-01-30 09:57:27 DEBUG Instantiating new ControlIQApi
2023-01-30 09:57:27 INFO Logging in to ControlIQApi...
2023-01-30 09:57:27 DEBUG Starting new HTTPS connection (1): tconnect.tandemdiabetes.com:443
2023-01-30 09:57:28 DEBUG https://tconnect.tandemdiabetes.com:443 "GET /login.aspx?ReturnUrl=%2F HTTP/1.1" 200 85100
2023-01-30 09:57:29 INFO Reported tconnect software version: t:connect 7.14.0.1
2023-01-30 09:57:30 DEBUG https://tconnect.tandemdiabetes.com:443 "POST /login.aspx?ReturnUrl=%2F HTTP/1.1" 302 148
2023-01-30 09:57:31 DEBUG https://tconnect.tandemdiabetes.com:443 "POST /CookieCheck.aspx?ReturnUrl=%2F HTTP/1.1" 302 118
2023-01-30 09:57:33 DEBUG https://tconnect.tandemdiabetes.com:443 "GET / HTTP/1.1" 200 216489
2023-01-30 09:57:34 INFO Logged in to ControlIQApi successfully (expiration: 2023-01-30T17:57:29.066Z, in 7 hours, 59 minutes)
2023-01-30 09:57:34 DEBUG Starting new HTTPS connection (1): tdcservices.tandemdiabetes.com:443
2023-01-30 09:57:35 DEBUG https://tdcservices.tandemdiabetes.com:443 "GET /tconnect/controliq/api/therapytimeline/users/55535a7f-0f6d-4b46-b05e-c50130149218?startDate=01-29-2023&endDate=01-30-2023 HTTP/1.1" 200 9729
2023-01-30 09:57:35 INFO Downloading t:connect therapy_events
2023-01-30 09:57:35 DEBUG Starting new HTTPS connection (1): tdcservices.tandemdiabetes.com:443
2023-01-30 09:57:37 DEBUG https://tdcservices.tandemdiabetes.com:443 "GET /tconnect/therapyevents/api/TherapyEvents/01-29-2023/01-30-2023/false?userId=55535a7f-0f6d-4b46-b05e-c50130149218 HTTP/1.1" 200 None
2023-01-30 09:57:37 DEBUG split_therapy_events: 14 bolus, 398 CGM, 0 BG, 0 basal
2023-01-30 09:57:37 DEBUG <tconnectsync.domain.therapy_event.CGMTherapyEvent object at 0x7358d3a0>
2023-01-30 09:57:37 INFO Last CGM reading from t:connect CIQ: 2023-01-30T09:09:29+00:00 (48 minutes ago)
2023-01-30 09:57:37 DEBUG Bolus(description='BLE Standard Bolus', complete='1', completion='Completed', request_time='2023-01-30 08:47:12+00:00', completion_time='2023-01-30 08:48:01+00:00', insulin='0.05', requested_insulin='0.05', carbs='0', bg='212', user_override='1', extended_bolus='0', bolex_completion_time='', bolex_start_time='')
2023-01-30 09:57:37 INFO Last bolus from t:connect CIQ: 2023-01-30T08:47:12 (1 hours, 10 minutes ago)
2023-01-30 09:57:38 DEBUG Adding basal event for unprocessed suspension: {'time': '2023-01-29 11:25:24+00:00', 'delivery_type': 'manual suspension', 'duration_mins': 16.0, 'basal_rate': 0.0}
2023-01-30 09:57:38 DEBUG No CSV basal data found
2023-01-30 09:57:38 INFO Last basal event from CIQ: {'time': '2023-01-30 08:34:28+00:00', 'delivery_type': 'algorithmDelivery', 'duration_mins': 36.43333333333333, 'basal_rate': 0.36}
2023-01-30 09:57:38 DEBUG Writing basal events
2023-01-30 09:57:38 DEBUG ns_write_basal_events: querying for last uploaded entry
2023-01-30 09:57:38 DEBUG Starting new HTTPS connection (1): XXXXXXX.fly.dev:443
2023-01-30 09:57:38 DEBUG https://XXXXXXX.fly.dev:443 "GET /api/v1/treatments?count=1&find%5BenteredBy%5D=Pump%20%28tconnectsync%29&find%5BeventType%5D=Temp%20Basal&find%5Bcreated_at%5D%5B$gte%5D=2023-01-29T09:57:27.798637+00:00&find%5Bcreated_at%5D%5B$lte%5D=2023-01-30T09:57:27.798637+00:00&ts=1675072658.5591228 HTTP/1.1" 200 None
2023-01-30 09:57:38 INFO Last Nightscout basal upload: 2023-01-30T08:34:28+00:00
2023-01-30 09:57:39 DEBUG ns_write_basal_events: added 0 events
2023-01-30 09:57:39 DEBUG Finished writing basal events
2023-01-30 09:57:39 INFO Processing ciqBolusData (14 entries)
Traceback (most recent call last):
File "/home/pi/.local/bin/tconnectsync", line 8, in
sys.exit(main())
File "/home/pi/.local/lib/python3.9/site-packages/tconnectsync/init.py", line 91, in main
added = process_time_range(tconnect, nightscout, time_start, time_end, args.pretend, features=args.features)
File "/home/pi/.local/lib/python3.9/site-packages/tconnectsync/process.py", line 174, in process_time_range
bolusEvents = process_bolus_events(ciqBolusData, source="ciq")
File "/home/pi/.local/lib/python3.9/site-packages/tconnectsync/sync/bolus.py", line 38, in process_bolus_events
if not parsed.bolex_start_time and not parsed.start_time:
AttributeError: 'Bolus' object has no attribute 'start_time'

@diabetesman should be resolved in v0.9.3. Thanks for the report!