-
Notifications
You must be signed in to change notification settings - Fork 471
Add push commands to open or hide full screen camera view #4688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eff86b8
Add push commands to open or hide full screen camera view
bgoncal 75056a5
PR improvements
bgoncal a777ddd
Fix Push CI Swift signing key import
bgoncal e85fd19
Skip Swift setup signature verification in Push CI
bgoncal b11d248
Pin Push CI runner for Swift 5.8
bgoncal 3219aa9
Run Push CI tests in Swift container
bgoncal 96ebbe5
Potential fix for pull request finding 'CodeQL / Workflow does not co…
bgoncal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
23 changes: 23 additions & 0 deletions
23
.../PushServer/Tests/SharedPushTests/notification_test_cases.bundle/command_hide_camera.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "input": { | ||
| "title": "extra excluded title", | ||
| "message": "hide_camera", | ||
| "registration_info": { | ||
| "app_id": "io.robbie.HomeAssistant.dev", | ||
| "os_version": "10.15", | ||
| "app_version": "2026.1" | ||
| } | ||
| }, | ||
| "rate_limit": false, | ||
| "headers": { | ||
| "apns-push-type": "background" | ||
| }, | ||
| "payload": { | ||
| "aps": { | ||
| "contentAvailable": true | ||
| }, | ||
| "homeassistant": { | ||
| "command": "hide_camera" | ||
| } | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
.../PushServer/Tests/SharedPushTests/notification_test_cases.bundle/command_show_camera.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "input": { | ||
| "title": "extra excluded title", | ||
| "message": "show_camera", | ||
| "data": { | ||
| "entity_id": "camera.front_door" | ||
| }, | ||
| "registration_info": { | ||
| "app_id": "io.robbie.HomeAssistant.dev", | ||
| "os_version": "10.15", | ||
| "app_version": "2026.1" | ||
| } | ||
| }, | ||
| "rate_limit": false, | ||
| "headers": { | ||
| "apns-push-type": "background" | ||
| }, | ||
| "payload": { | ||
| "aps": { | ||
| "contentAvailable": true | ||
| }, | ||
| "homeassistant": { | ||
| "command": "show_camera", | ||
| "entity_id": "camera.front_door" | ||
| } | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
Sources/Shared/Notifications/NotificationCommands/HandlerHideCamera.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #if os(iOS) | ||
| import Foundation | ||
| import PromiseKit | ||
|
|
||
| struct HandlerHideCamera: NotificationCommandHandler { | ||
| func handle(_ payload: [String: Any]) -> Promise<Void> { | ||
| Promise<Void> { seal in | ||
|
bgoncal marked this conversation as resolved.
|
||
| let postNotification = { | ||
| NotificationCenter.default.post( | ||
| name: NotificationCommandManager.didReceiveHideCameraNotification, | ||
| object: nil | ||
| ) | ||
| seal.fulfill(()) | ||
| } | ||
|
|
||
| if Thread.isMainThread { | ||
| postNotification() | ||
| } else { | ||
| DispatchQueue.main.async(execute: postNotification) | ||
| } | ||
| } | ||
| } | ||
| } | ||
| #endif | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.