Skip to content

Conversation

@bjorkert
Copy link
Contributor

1. DeviceStatus.swift:
• Corrected the count parameter for device status downloads from 288 to 1, as only one record is needed. The initial value was a copy-paste error, which led to unnecessary data being downloaded.
2. BGData.swift:
• Adjusted the count parameter to dynamically calculate the limit of BG values to download. The new formula accounts for both Loop/Trio and Dexcom Share data, leading to 2 * 288 BG values per day.
• Previous hardcoded value: 1000. Two days of double data results in 1152 values.
• New dynamic value: UserDefaultsRepository.downloadDays.value * 2 * 24 * 60 / 5

@bjorkert bjorkert requested a review from marionbarker July 10, 2024 19:13
@marionbarker
Copy link
Collaborator

The code review looks good.
Tested and it works.
Used Trio and Loop NS sources and increased display days to 4. All data is displayed.

Future question:
Q: Do we need to future proof this for a 1-minute CGM update rate?
A: Not at this time and it would be a separate PR.

@marionbarker marionbarker merged commit a64b98d into dev Jul 11, 2024
@marionbarker marionbarker deleted the count-adjustment branch July 11, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants