Skip to content

Siri and Shortcuts support for status readouts and alarm snoozing - #770

Open
bjorkert wants to merge 1 commit into
devfrom
feature/siri-app-intents
Open

bjorkert wants to merge 1 commit into
devfrom
feature/siri-app-intents

Conversation

@bjorkert

Copy link
Copy Markdown
Member

Closes #768.

Adds App Intents so Siri and the Shortcuts app can read out what LoopFollow shows and snooze alarms. Nothing here sends remote commands.

Ask "What's the status in Loop Follow" for glucose, trend, delta, reading age, IOB, COB, last loop and any active override or temp target. "What's the glucose in Loop Follow" gives just the glucose line and returns the value as a number for automations. "What's the IOB in Loop Follow" works for twenty values such as COB, basal rate, pump reservoir, sensor age, last loop, recommended bolus and alarm status. Alarm phrases: snooze all alarms (30 minutes to 12 hours, default one hour), end snooze, and snooze the alarm that is sounding. Mute, unmute and alarm status are available in the Shortcuts app only, which keeps the count under Apple's limit of ten App Shortcuts.

The readout uses the live state when the app is running and the saved glucose snapshot when Siri launches the app in the background, and it always says how old the reading is. Readings older than 12 minutes are announced with their age first. Dexcom Share followers get only the glucose line. The existing three shortcuts moved into a new provider file with the new ones.

Phrases and answers are English only, so Siri must be set to English for the phrases to work. Custom shortcuts with a name in another language can still run the actions.

Tests cover the spoken text in both units and an in-process run of the intents. Siri phrase recognition was checked only through the Shortcuts app in the simulator, so a quick check on a device would be good. Docs for lf-features.md are coming in a separate PR in loopfollowdocs.

App Intents for the current status, glucose, single status values, and local alarm snooze, end snooze, mute, unmute and snooze current alarm. The status readout is built from the saved glucose snapshot when no live glucose is in memory, so it also works when Siri launches the app in the background. Six of the intents are registered as App Shortcuts with Siri phrases. Includes unit tests for the spoken text and an in-process test of the intents.
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.

Add ability to get current status via Siri Siri shortcut

1 participant