Repository navigation
Record Eversense alarms that stop glucose as CGM events - #3
Merged
Merged
Conversation
The sensorStart CGM event was guarded by hasReportedInsertionDate, which only onboarding reset, so a new sensor on the same transmitter never got one. Track the sensor it was sent for instead. The flag from earlier versions is read as meaning the current sensor, so updating doesn't resend it.
When the transmitter raises an alarm whose description says glucose stops (no sensor detected, temperature, calibration expired, empty battery, sensor retired and so on), send Loop a sensorIssue named for the alarm, with its raw code. Transmitter alarms are recorded under the transmitter ID, sensor alarms under the sensor ID. A retired sensor's sensorEnd is sent once. The active alarms were already persisted, so an alarm is recorded once while it stays active.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Records Eversense alarms that stop glucose as CGM events, like G7 (LoopKit/G7SensorKit#90), G5/G6 (LoopKit/CGMBLEKit#224) and Libre 3 (LoopKit/LibreLoop#19), using the
sensorIssuetype from LoopKit/LoopKit#637.error.codeis the alarm name andmetadata.alarmCodeits raw code. None are marked fatal.The first commit is bastiaanv#66 (
sensorStartfor each new sensor), which goes upstream too. These events stay onloop-next-devbecausesensorIssueandCgmEventErrorexist only in LoopKit next-dev.Tests:
CgmEventTests(3),SensorStartTests(2).