Skip to content

Conversation

@ccutrer
Copy link
Collaborator

@ccutrer ccutrer commented Oct 17, 2025

Pull Request Checklist

Please confirm that you've done the following when opening a new pull request:

  • For fixes and other improvements, please reference the GitHub issue that your change addresses.
  • For fixes, optimizations and new features, please add an entry to the CHANGES.md file.
  • Run mvn compile before committing, so that the auto-code formatter will format your changes consistently with the rest of the project.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ccutrer ccutrer force-pushed the username-in-characteristic-writes branch from 4896ec2 to ea14c5d Compare October 17, 2025 16:38
Copy link
Contributor

@yfre yfre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thank you @ccutrer !

@yfre yfre merged commit 557aac4 into hap-java:master Oct 18, 2025
1 check passed
@ccutrer ccutrer deleted the username-in-characteristic-writes branch October 18, 2025 13:08
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.

2 participants