Repository navigation
Conversation
The callback set by LinkPlayController.get_bridge_callback() is async, but
update_status() called it without awaiting, so discover_multirooms() never
ran when a player moved into or out of follower mode ("coroutine ... was
never awaited"). Await it and annotate the callback as returning an
Awaitable. The tests mocked it with a sync Mock, which hid the bug; use
AsyncMock and assert it is awaited.
Fixes velbus#135
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daniel-simpson
approved these changes
Nov 12, 2026
This branch has not been deployed
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.
Fixes #135
Problem
LinkPlayPlayer.update_status()callsself.bridge.device.controller()when a player moves into or out of follower mode. That callback comes fromLinkPlayController.get_bridge_callback()and isasync, so calling it withoutawaitonly creates a coroutine object.discover_multirooms()never runs, and Python logs:In Home Assistant this shows up as
group_membersnot updating after a join until alinkplayconfig entry is reloaded.Changes
bridge.py:await self.bridge.device.controller().update_status()is alreadyasync, so no other changes are needed.bridge.py: annotateLinkPlayDevice.controllerandset_callback()asCallable[[], Awaitable[None]], matching what the controller actually passes.tests/linkplay/test_bridge.py: the threeupdate_statuscontroller tests used a syncMock(), which worked whether or not the call was awaited and so hid the bug. They now useAsyncMock()withassert_awaited_once()/assert_not_awaited().Testing
bridge.py, the two "triggers controller" tests fail as expected. With the fix, the full suite passes: 290 passed, 1 skipped.-W error::RuntimeWarning.mypy srcreports the same result before and after: one existing error, missing stubs for an import inutils.py.ruffin my environment. The only lint rule enabled isI; the import line stays sorted, and the longest changed line is 78 characters.🤖 Generated with Claude Code