Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions homeassistant/components/sonos/speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,12 +940,14 @@ def _async_regroup(group: list[str]) -> None:

for uid in group:
speaker = self.data.discovered.get(uid)
if speaker:
entity_id = (
entity_registry.async_get_entity_id(MP_DOMAIN, DOMAIN, uid)
if speaker
else None
)
if speaker and entity_id:
self._group_members_missing.discard(uid)
sonos_group.append(speaker)
entity_id = cast(
str, entity_registry.async_get_entity_id(MP_DOMAIN, DOMAIN, uid)
)
sonos_group_entities.append(entity_id)
else:
self._group_members_missing.add(uid)
Expand Down
3 changes: 0 additions & 3 deletions tests/components/sonos/test_media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ async def test_device_registry_not_portable(
assert reg_device.area_id == area_registry.async_get_area_by_name("Zone A").id


@pytest.mark.skip(
reason="Flaky due to Python 3.14.3 asyncio changes - see home-assistant/core#162263"
)
async def test_entity_basic(
hass: HomeAssistant,
async_autosetup_sonos,
Expand Down
9 changes: 2 additions & 7 deletions tests/components/sonos/test_repairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from unittest.mock import Mock

import pytest
from soco import SoCo

from homeassistant.components.sonos.const import (
Expand All @@ -19,9 +18,6 @@
from tests.common import MockConfigEntry, async_fire_time_changed


@pytest.mark.skip(
reason="Flaky due to Python 3.14.3 asyncio changes - see home-assistant/core#162263"
)
async def test_subscription_repair_issues(
hass: HomeAssistant,
config_entry: MockConfigEntry,
Expand All @@ -44,13 +40,12 @@ async def test_subscription_repair_issues(

# Ensure the issue still exists after reload
assert await hass.config_entries.async_reload(config_entry.entry_id)
await hass.async_block_till_done()
await hass.async_block_till_done(wait_background_tasks=True)
assert issue_registry.async_get_issue(DOMAIN, SUB_FAIL_ISSUE_ID)

# Ensure the issue has been removed after a successful subscription callback
variables = {"ZoneGroupState": zgs_discovery}
event = SonosMockEvent(soco, soco.zoneGroupTopology, variables)
sub_callback(event)
await hass.async_block_till_done()
assert not issue_registry.async_get_issue(DOMAIN, SUB_FAIL_ISSUE_ID)
await hass.async_block_till_done(wait_background_tasks=True)
assert not issue_registry.async_get_issue(DOMAIN, SUB_FAIL_ISSUE_ID)
3 changes: 0 additions & 3 deletions tests/components/sonos/test_speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ async def _media_play(hass: HomeAssistant, entity: str) -> None:
)


@pytest.mark.skip(
reason="Flaky due to Python 3.14.3 asyncio changes - see home-assistant/core#162263"
)
async def test_zgs_event_group_speakers(
hass: HomeAssistant, sonos_setup_two_speakers: list[MockSoCo]
) -> None:
Expand Down