Skip to content
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

homekit-server: add pairing API #1128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mnakada
Copy link

@mnakada mnakada commented May 20, 2024

Current issues:

  1. when HomeHub (AppleTV, HomePod) is being used with HomeKit and the device is deleted from the iOS Home app, the HomeHub pairing information remains and the next registration is not possible.

  2. If a device is deleted from the iOS Home app while go2rtc is not running, the device does not exist in the Home app, but the go2rtc pairing information remains, so the next registration cannot be performed.

Suggested correction:
Regarding the first problem,
The current code deletes only the pairing information that has the same id in DelPair in internal/homekit/server.go.
In HomeKit, one stream cannot be registered to multiple homes.
Therefore, when deleting pairing information with permissions=1, modify to delete all pairing information of stream.
If permissions=0, delete only the pairing information of the HomeHub, since it is the HomeHub's information.

Since the second problem cannot be handled automatically, add an API for deleting pairing information.
GET to get the current pairing information, and DELETE to delete the pairing that has been deleted by Query.

  • GET api/homekit/pairing
  • get the pairing information.
  • DELETE api/homekit/pairing?[stream='stream' | name='mDNSname' | device_id='deviceID' ]
  • remove the pairing that has been deleted by Query.

- GET api/homekit/pairing
-   get the pairing information.
- DELETE api/homekit/pairing?[stream='stream' | name='mDNSname' | device_id='deviceID' ]
-   remove the pairing that has been deleted by Query.
mnakada and others added 2 commits May 21, 2024 06:15
Co-authored-by: Sergey Krashevich <svk@svk.su>
…s it waits a long time to be notified of updates.

That will cause a MultiCast Query and Response in mDNS to update the homekit information.
@mnakada mnakada requested a review from skrashevich May 22, 2024 13:56
@mnakada mnakada mentioned this pull request May 25, 2024
@AlexxIT AlexxIT self-assigned this May 28, 2024
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.

None yet

3 participants