Skip to content

Commit

Permalink
Update media_player.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aunefyren committed Jan 30, 2024
1 parent 0574477 commit 94b301c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/bluesound_alt/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,18 @@ async def async_update_status(self):
self._last_status_update = dt_util.utcnow()
self._status = xmltodict.parse(result)["status"].copy()

# update group name
group_name = self._status.get("groupName")
self._group_name = group_name

# rebuild ordered list of entity_ids that are in the group, master is first
self._group_list = await self.rebuild_bluesound_group()

# the sleep is needed to make sure that the
# devices is synced
await asyncio.sleep(1)
await self.async_trigger_sync_on_all()

if self.is_grouped:
# when player is grouped we need to fetch volume from
# sync_status. We will force an update if the player is
Expand All @@ -423,6 +427,7 @@ async def async_update_status(self):
# the device is playing. This would solve a lot of
# problems. This change will be done when the
# communication is moved to a separate library
await asyncio.sleep(1)
await self.force_update_sync_status()

self.async_write_ha_state()
Expand Down

0 comments on commit 94b301c

Please sign in to comment.