mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Fix error when personalDetail
is missing in PlayStation Network integration (#148389)
This commit is contained in:
parent
a77a071954
commit
f58c76c883
@ -156,9 +156,9 @@ class PlaystationNetworkSensorEntity(
|
|||||||
def entity_picture(self) -> str | None:
|
def entity_picture(self) -> str | None:
|
||||||
"""Return the entity picture to use in the frontend, if any."""
|
"""Return the entity picture to use in the frontend, if any."""
|
||||||
if self.entity_description.key is PlaystationNetworkSensor.ONLINE_ID and (
|
if self.entity_description.key is PlaystationNetworkSensor.ONLINE_ID and (
|
||||||
profile_pictures := self.coordinator.data.profile["personalDetail"].get(
|
profile_pictures := self.coordinator.data.profile.get(
|
||||||
"profilePictures"
|
"personalDetail", {}
|
||||||
)
|
).get("profilePictures")
|
||||||
):
|
):
|
||||||
return next(
|
return next(
|
||||||
(pic.get("url") for pic in profile_pictures if pic.get("size") == "xl"),
|
(pic.get("url") for pic in profile_pictures if pic.get("size") == "xl"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user