Repository navigation
Fix friends' achievement stats in Xbox integration - #182686
Conversation
|
Hey there @tr4nt0r, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused implementation matches the dependency API and includes regression coverage for the corrected XUID.
Review effort: Balanced
Findings: None
What changed in this PR
Updates Xbox presence data to fetch title statistics for each tracked person’s XUID.
Changes:
- Uses
get_title_info_by_xuidfor person-specific achievements. - Adds a playing-friend fixture and regression test.
- Extends the mocked Title Hub API.
| File | Description |
|---|---|
homeassistant/components/xbox/coordinator.py |
Requests title details using each person’s XUID. |
tests/components/xbox/conftest.py |
Mocks the new API method. |
tests/components/xbox/test_init.py |
Verifies the friend XUID is passed. |
tests/components/xbox/fixtures/people_friends_own_playing.json |
Provides friend presence test data. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tr4nt0r
left a comment
There was a problem hiding this comment.
Good catch by the way! I never noticed that it was showing the own achievement info 😂
I have just some small remarks about the tests.
|
Applied both test suggestions. erics273 is now online and playing Minecraft, and the mock returns title info per xuid from The two title fixtures give the owner and erics273 I left the |
Proposed change
The Xbox integration fetches title info for every person it tracks, but the call always used the signed-in account's xuid. The achievements, gamerscore and progress shown for a friend were the signed-in user's own figures for that game.
python-xbox 0.3.0 added
get_title_info_by_xuid. With this change, the coordinator now passes each person's xuid, so a friend's card shows their own figures. The signed-in account is unaffected.A new test fixture puts a friend in a game.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: