Added feature to trigger a shortcut when light is turned on or off#11
Open
zachcasper wants to merge 1 commit intoraine:mainfrom
Open
Added feature to trigger a shortcut when light is turned on or off#11zachcasper wants to merge 1 commit intoraine:mainfrom
zachcasper wants to merge 1 commit intoraine:mainfrom
Conversation
Signed-off-by: Zach Casper <zachcasper@microsoft.com>
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.
This pull request adds support for running Apple Shortcuts automatically when Elgato lights are turned on or off. Users can now specify shortcut names in the Automation Settings, and the app will trigger the corresponding Shortcut whenever the light state changes. The update also improves documentation and internal event handling to support this feature.
Apple Shortcut Integration:
@AppStorageproperties toAppStatefor storing the names of Shortcuts to run when lights turn on or off (shortcutOnLightOn,shortcutOnLightOff).AutomationSettingsViewto include text fields for users to enter Shortcut names, and ensured these fields are reset to defaults when requested. [1] [2]ShortcutTriggerControllerclass, instantiated inAppCoordinator, to handle triggering Shortcuts based on light state changes. [1] [2]ShortcutTriggerController.swiftto the build and source lists. [1] [2] [3] [4]Light State Change Event Handling:
lightStateChangedstaticPassthroughSubjecttoElgatoDevice, and publish an event every time the light's on/off state is changed. This enables other components (like the shortcut trigger) to react to light state changes. [1] [2]Documentation Updates:
README.mdto document the new Apple Shortcuts integration and provide usage instructions for triggering Shortcuts on light state changes. [1] [2]