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.
Current issues:
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.
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.