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