Allow characteristic setters to get the username of the triggering connection#190
Merged
yfre merged 1 commit intohap-java:masterfrom Oct 18, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds the ability for characteristic setters to receive the username of the triggering connection, enabling developers to track which authenticated user made changes to device characteristics.
Key Changes:
- Extended the characteristic setter chain to include an optional username parameter throughout the API
- Modified the pairing verification flow to capture and propagate the authenticated username through the connection lifecycle
- Added backward-compatible default implementations to maintain existing API compatibility
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| UpgradeResponse.java | Added username field to store authenticated user identity during connection upgrade |
| PairVerifyManager.java | Extracted username string to pass to UpgradeResponse and reuse in logging |
| CharacteristicsController.java | Updated characteristic setValue call to include connection username |
| HomekitClientConnection.java | Added getUsername() method to interface with default null implementation |
| ConnectionImpl.java | Implemented username storage and getter from upgrade response |
| HomekitServer.java | Applied code formatting to method call |
| StringCharacteristic.java | Added setValue overload accepting username parameter |
| IntegerCharacteristic.java | Added setValue overload accepting username parameter |
| FloatCharacteristic.java | Added setValue overload accepting username parameter |
| EnumCharacteristic.java | Added setValue overloads accepting username parameter for both generic and Integer types |
| BooleanCharacteristic.java | Added setValue overload accepting username parameter |
| BaseCharacteristic.java | Added setValue overload and default implementation with username parameter |
| ExceptionalConsumer.java | Added default accept method overload with username parameter |
| Characteristic.java | Added setValue interface method with username parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
4896ec2 to
ea14c5d
Compare
yfre
approved these changes
Oct 18, 2025
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.
Pull Request Checklist
Please confirm that you've done the following when opening a new pull request: