You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Controller callback in update_status() is never awaited, so multiroom changes aren't picked up #135
Version: python-linkplay 0.2.14, through Home Assistant core 2026.10.2 (Home Assistant OS) Devices: WiiM Pro (leader), 2× Audio Pro Addon C3 (WiiMu-A28, firmware 4.6.337158), each set up as its own linkplay config entry
Problem
The controller callback that should refresh multiroom groups is never awaited, so discover_multirooms() never runs when a device moves into or out of follower mode. Every time a speaker is joined, Home Assistant logs:
WARNING (MainThread) [py.warnings] /usr/local/lib/python3.14/site-packages/linkplay/bridge.py:180: RuntimeWarning: coroutine 'LinkPlayController.get_bridge_callback.<locals>.callback' was never awaited
self.bridge.device.controller()
controller is the callback from LinkPlayController.get_bridge_callback() (controller.py#L21-L29), which is async def callback() and awaits self.discover_multirooms(). Calling it without await only creates a coroutine object, so the group re-read never runs. The Callable[[], None] annotations on LinkPlayDevice.controller and set_callback() hide this from type checkers.
Steps to reproduce (Home Assistant)
Set up the leader and a follower under the linkplay integration.
Call media_player.join with the leader as target and the follower in group_members.
The devices group correctly: multiroom:getSlaveList on the leader lists the follower, and the follower's getStatusEx reports the leader's master_uuid.
group_members in Home Assistant isn't updated, and the warning above is logged. It stays stale through normal polling and homeassistant.update_entity.
Reloading any linkplay config entry, which runs discover_multirooms() during setup, immediately shows the correct group on all players.
media_player.unjoin is reflected correctly.
Suggested fix
update_status() is already async, so:
awaitself.bridge.device.controller()
with the annotations changed to Callable[[], Awaitable[None]].
Possibly related: #134 (exceptions escaping discover_multirooms()). Once this callback actually runs, any such exception would reach update_status().
Confirming on python-linkplay 0.2.14 via Home Assistant core 2026.10.2 (three WiiM/Linkplay speakers, one linkplay config entry each).
I see the same RuntimeWarning: coroutine 'LinkPlayController.get_bridge_callback.<locals>.callback' was never awaited at bridge.py:180 after media_player.join.
One more consequence: unjoin called shortly after a join is silently a no-op. async_unjoin_player reads self._bridge.multiroom, which is still None because the group was never re-read, so no multiroom:SlaveKickout is sent. The debug log shows ConnectMasterAp:JoinGroupMaster for the join and nothing for the first unjoin. A second unjoin about 80 seconds later worked.
I checked #136 locally. With the real get_bridge_callback() and a player moving to follower mode:
on main, the warning is raised and discover_multirooms() is never called
If discover_multirooms() raises LinkPlayRequestException (see #134), it now propagates out of update_status(). previous_playing_mode is not updated in that case, so the callback is retried on the next poll, which seems like the right behaviour. It is worth knowing, though, because Home Assistant counts that exception as a failed poll.
#136 looks right to me and the suite passes (290 passed). Could a maintainer take a look?
Activity
daniel-simpson commentedon Nov 12, 2026
Confirming on python-linkplay 0.2.14 via Home Assistant core 2026.10.2 (three WiiM/Linkplay speakers, one
linkplayconfig entry each).I see the same
RuntimeWarning: coroutine 'LinkPlayController.get_bridge_callback.<locals>.callback' was never awaitedatbridge.py:180aftermedia_player.join.One more consequence:
unjoincalled shortly after a join is silently a no-op.async_unjoin_playerreadsself._bridge.multiroom, which is stillNonebecause the group was never re-read, so nomultiroom:SlaveKickoutis sent. The debug log showsConnectMasterAp:JoinGroupMasterfor the join and nothing for the first unjoin. A second unjoin about 80 seconds later worked.I checked #136 locally. With the real
get_bridge_callback()and a player moving to follower mode:main, the warning is raised anddiscover_multirooms()is never calleddiscover_multirooms()runs onceIf
discover_multirooms()raisesLinkPlayRequestException(see #134), it now propagates out ofupdate_status().previous_playing_modeis not updated in that case, so the callback is retried on the next poll, which seems like the right behaviour. It is worth knowing, though, because Home Assistant counts that exception as a failed poll.#136 looks right to me and the suite passes (290 passed). Could a maintainer take a look?