Optimize Sonos unjoin behavior when using media_player.unjoin
(#74086)
* Coalesce Sonos unjoins to process together * Refactor for readability * Skip unjoin call if already ungrouped * Store unjoin data in a dedicated dataclass * Revert import adjustment
This commit is contained in:
parent
abe44a100f
commit
4bfdb1433e
3 changed files with 38 additions and 4 deletions
|
@ -906,6 +906,8 @@ class SonosSpeaker:
|
|||
@soco_error()
|
||||
def unjoin(self) -> None:
|
||||
"""Unjoin the player from a group."""
|
||||
if self.sonos_group == [self]:
|
||||
return
|
||||
self.soco.unjoin()
|
||||
self.coordinator = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue