Skip to content

Add sensor life configuration for Anubis transmitters #8

Open
MikePlante1 wants to merge 2 commits into
loopandlearn:devfrom
MikePlante1:anubis
Open

Add sensor life configuration for Anubis transmitters #8
MikePlante1 wants to merge 2 commits into
loopandlearn:devfrom
MikePlante1:anubis

Conversation

@MikePlante1

Copy link
Copy Markdown

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

  • Anubis detection: the transmitter expiry (bytes 13–14 of the version-rx
    frame) is read on connect until known (needsExpiryRead) and persisted in
    TransmitterManagerState; a reported 180-day lifetime identifies an Anubis
    transmitter.
  • Configurable sensor life: transmitter settings gain a wheel picker for
    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.
  • Dynamic session expiry: sessionExpDate is stamped on each reading from
    the configured sensor life, and refreshed when the setting changes or the
    transmitter reports its expiry.
  • Sensor-start event metadata: the logged sensor-start event now uses the
    configured expectedLifetime, and a warmupPeriod of 50 min for Anubis vs
    2 h for stock.
  • Progress bar visibility: the session lifecycle ring stays hidden until
    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.
1 2

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.
@MikePlante1
MikePlante1 requested a review from dnzxy July 17, 2026 04:21
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.

1 participant