Add sun-geometry App Intents for Shortcuts/HomeKit automations#141
Open
Add sun-geometry App Intents for Shortcuts/HomeKit automations#141
Conversation
Adds 8 new App Intents exposing real-time solar geometry so Shortcuts and HomeKit automations can drive behaviour from actual azimuth/altitude rather than clock offsets: - GetSunAltitude, GetSunAzimuth, IsSunUp (priority 1) - GetSolarNoon, IsSunOnBearing, GetSunPositionAtTime (priority 2) - GetNextAltitudeCrossing, GetNextAzimuthCrossing (priority 3) All default to the current location and now, use LocationAppEntity (modern approach; older intents still use CLPlacemark for migration), return Measurement<UnitAngle> where appropriate, and register with the existing SolsticeShortcutsProvider. Extends NTSolar with a shared altitudeAndAzimuth(at:) method so the existing altitude(at:) continues to work; adds a new azimuth(at:) alongside it. Crossing searches bisect over a 24-hour window using 1-minute sampling, skipping the azimuth ±180° wrap discontinuity. Bumps marketing version to 3.2.0.
- Drop @parameter(description:) usage: that init overload requires iOS/macOS 26.0+, but the main app target is macOS 15.6. - Stop using a non-literal default for the tolerance Measurement in IsSunOnBearing (visionOS AppIntents requires defaults to be literals). Make tolerance optional and default to 60° inside perform(). - Trim AppShortcutsProvider from 12 to 10 entries (the framework cap). The priority-3 crossing intents are still registered and available via Shortcuts search, just not surfaced in the suggested gallery.
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.
Adds 8 new App Intents exposing real-time solar geometry so Shortcuts
and HomeKit automations can drive behaviour from actual azimuth/altitude
rather than clock offsets:
All default to the current location and now, use LocationAppEntity
(modern approach; older intents still use CLPlacemark for migration),
return Measurement where appropriate, and register with the
existing SolsticeShortcutsProvider.
Extends NTSolar with a shared altitudeAndAzimuth(at:) method so the
existing altitude(at:) continues to work; adds a new azimuth(at:)
alongside it. Crossing searches bisect over a 24-hour window using
1-minute sampling, skipping the azimuth ±180° wrap discontinuity.
Bumps marketing version to 3.2.0.