Add sensor life configuration for Anubis transmitters #8
Conversation
Implements user-configurable sensor session length (10–60 days) for Anubis-modded transmitters, while maintaining stock 10-day sessions for standard G5/G6 transmitters. Key changes: - Transmitter version frame detection identifies Anubis modification (180-day expiry) - sessionExpDate now updated dynamically based on configured sensor life - Warmup period adjusted for Anubis (50 min) vs stock (2 h) - Settings UI provides wheel picker for sensor life selection (10–60 days) - State persistence for selected sensor life across app sessions
Add a guard statement to keep the session progress ring hidden until the transmitter session enters its final 48 hours. This improves the user experience by reducing visual clutter during the early stages of a session.
|
@marionbarker I'd like to merge this. Then we PR this from here to upstream CGMBLEKit. Is that okay with you? No one other than Trio uses this forked submodule afaik? |
|
@ps2 could you have a brief look at this, if you can accept this as-is to |
Since LoopKit#215 is open from dev, merging this PR will just update that one. |
|
No. I keep loopandlearn trio branch available for any items like this where loopandlearn differs from the upstream fork.
I see that tests were requested and submitted for LoopKit#215. That PR (215) should never have been submitted from loopandlearn dev branch. It should have been from a feature branch. Is the MikePlante1:anubis branch what you want to have eventually merged into LoopKit/CGMBLEKit? |
|
OK @MikePlante1 explained the situation to me. I was not noticing when #6 and #7 went past. |
Test✅ successful test Trio TestStarted with Trio dev branch, 0.8.4.24, and then pointed to MikePlante1:anubis for CGMBLEKit. Loop TestStarted with Loop dev branch, v3.14.3, and then pointed to MikePlante1:anubis for CGMBLEKit. |
There was a problem hiding this comment.
There are several places within the last few commits for Anubis where the Trio countdown ring is explicitly mentioned.
This should be agnostic to how the OS-AID app is using the lifecycle and warmup duration. Loop uses a line underneath the CGM display, Trio uses a ring. I would prefer those comments be updated to refer to lifecycle or warmup.
This is found in 3 places:
CGMBLEKit/CGMBLEKitUI/TransmitterManager+UI.swift
lines 105, 106 and 124.
marionbarker
left a comment
There was a problem hiding this comment.
Approve from code review and test for Trio and Loop.
Summary
Adds user-configurable sensor session length (10–60 days) for Anubis-modded
G6 transmitters, while stock G5/G6 transmitters keep the standard 10-day
session. Also limits the sensor lifecycle progress bar on the main view so it
only appears during the final 48 hours of a session, matching G7SensorKit
behavior.
Builds on the earlier work surfacing G5/G6 sensor lifecycle and detecting
Anubis-modded transmitters via the version frame.
Changes
frame) is read on connect until known (
needsExpiryRead) and persisted inTransmitterManagerState; a reported 180-day lifetime identifies an Anubistransmitter.
session length (10–60 days), shown for Anubis transmitters only. The value
is clamped, persisted across app restarts, and stock transmitters remain
fixed at 10 days.
sessionExpDateis stamped on each reading fromthe configured sensor life, and refreshed when the setting changes or the
transmitter reports its expiry.
configured
expectedLifetime, and awarmupPeriodof 50 min for Anubis vs2 h for stock.
the final 48 h of the session (warning state inside 24 h, critical at
expiry), matching G7SensorKit. Without this gate the bar sits on the main
view for the entire session. The warmup ring is unaffected.