Repository navigation
Report the paired sensor's model and send status updates - #24
Merged
Merged
Conversation
The device model was always "Libre 3", so Libre 3 Plus sensors were mislabeled. It now uses the sensor model captured at pairing. Status updates were only sent to status observers, so Loop never heard about status changes after setup. setState now also sends the current status to the delegate.
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.
HKDevice.modelwas always "Libre 3", so Libre 3 Plus sensors were mislabeled. It now usesstate.sensorModel, which comes from the NFC patch info at pairing. The name follows it ("FreeStyle Libre 3 Plus"). The model is nil before a sensor is paired.setStatenow also callscgmManager(_:didUpdate:)on the delegate. Status changes previously only went to status observers (the HUD), so Loop's view of the status, includinghasValidSensorSessionand the device model, was only refreshed at setup and launch. G7SensorKit sends this status update on every state change too.Needed for the "CGM Model" analytics property in LoopKit/Loop#2582.
Tested: simulator build of the LoopWorkspace scheme. Not tested with a sensor.