mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 03:03:17 +01:00
Rename group attribute in PlayStation Network (#161702)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -111,13 +111,13 @@ async def async_setup_entry(
|
||||
class PlaystationNetworkNotifyBaseEntity(PlaystationNetworkServiceEntity, NotifyEntity):
|
||||
"""Base class of PlayStation Network notify entity."""
|
||||
|
||||
group: Group | None = None
|
||||
psn_group: Group | None = None
|
||||
|
||||
def _send_message(self, message: str) -> None:
|
||||
"""Send message."""
|
||||
if TYPE_CHECKING:
|
||||
assert self.group
|
||||
self.group.send_message(message)
|
||||
assert self.psn_group
|
||||
self.psn_group.send_message(message)
|
||||
|
||||
def send_message(self, message: str, title: str | None = None) -> None:
|
||||
"""Send a message."""
|
||||
@@ -155,7 +155,7 @@ class PlaystationNetworkNotifyEntity(PlaystationNetworkNotifyBaseEntity):
|
||||
group_id: str,
|
||||
) -> None:
|
||||
"""Initialize a notification entity."""
|
||||
self.group = coordinator.psn.psn.group(group_id=group_id)
|
||||
self.psn_group = coordinator.psn.psn.group(group_id=group_id)
|
||||
group_details = coordinator.data[group_id]
|
||||
self.entity_description = NotifyEntityDescription(
|
||||
key=group_id,
|
||||
@@ -197,8 +197,8 @@ class PlaystationNetworkDirectMessageNotifyEntity(PlaystationNetworkNotifyBaseEn
|
||||
super().__init__(coordinator, self.entity_description)
|
||||
|
||||
def _send_message(self, message: str) -> None:
|
||||
if not self.group:
|
||||
self.group = self.coordinator.psn.psn.group(
|
||||
if not self.psn_group:
|
||||
self.psn_group = self.coordinator.psn.psn.group(
|
||||
users_list=[self.coordinator.psn.friends_list[self.account_id]]
|
||||
)
|
||||
super()._send_message(message)
|
||||
|
||||
Reference in New Issue
Block a user