1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Prevent startup blocking when a friend’s trophy summary is private on PlayStation Network (#157597)

Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Manu
2025-12-03 16:29:51 +01:00
committed by Franck Nijhof
parent a9deb2a08a
commit 06d4f085c0

View File

@@ -251,13 +251,7 @@ class PlaystationNetworkFriendDataCoordinator(
def _update_data(self) -> PlaystationNetworkData:
"""Update friend status data."""
try:
return PlaystationNetworkData(
username=self.user.online_id,
account_id=self.user.account_id,
presence=self.user.get_presence(),
profile=self.profile,
trophy_summary=self.user.trophy_summary(),
)
presence = self.user.get_presence()
except PSNAWPForbiddenError as error:
raise UpdateFailed(
translation_domain=DOMAIN,
@@ -267,6 +261,19 @@ class PlaystationNetworkFriendDataCoordinator(
except PSNAWPError:
raise
try:
trophy_summary = self.user.trophy_summary()
except PSNAWPForbiddenError:
trophy_summary = None
return PlaystationNetworkData(
username=self.user.online_id,
account_id=self.user.account_id,
profile=self.profile,
presence=presence,
trophy_summary=trophy_summary,
)
async def update_data(self) -> PlaystationNetworkData:
"""Update friend status data."""
return await self.hass.async_add_executor_job(self._update_data)