Skip to content

Commit

Permalink
Raise PlatformNotReady if _sync_status is not available yet
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisChrist committed May 12, 2024
1 parent d302526 commit a649a6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/bluesound/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.exceptions import PlatformNotReady, ServiceValidationError
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import format_mac
Expand Down Expand Up @@ -382,7 +382,7 @@ async def async_update_status(self):
def unique_id(self) -> str | None:
"""Return an unique ID."""
if self._sync_status is None:
return None
raise PlatformNotReady
return f"{format_mac(self._sync_status.mac)}-{self.port}"

async def async_trigger_sync_on_all(self):
Expand Down

0 comments on commit a649a6b

Please sign in to comment.