Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust for breaking Sonos change in HA 2022.5 (TS version) #656

Merged
merged 3 commits into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ export default class MediaPlayerObject {
if (this.platform === PLATFORM.SQUEEZEBOX) {
return this._attr.sync_group || [];
}
if (this.platform === PLATFORM.MEDIAPLAYER || this.platform === PLATFORM.HEOS) {
if (this.platform === PLATFORM.MEDIAPLAYER || this.platform === PLATFORM.HEOS
|| this.platform === PLATFORM.SONOS) {
return this._attr.group_members || [];
}
return (this._attr[`${this.platform}_group`] || []) as string[];
Expand Down Expand Up @@ -392,14 +393,15 @@ export default class MediaPlayerObject {
PLATFORM.SQUEEZEBOX,
);
case PLATFORM.MEDIAPLAYER:
case PLATFORM.SONOS:
return this.callService(
e,
'join',
{
entity_id: this._entityId,
group_members: entity,
},
platform,
PLATFORM.MEDIAPLAYER,
);
case PLATFORM.HEOS:
return this.callService(
Expand All @@ -421,13 +423,14 @@ export default class MediaPlayerObject {
case PLATFORM.SQUEEZEBOX:
return this.callService(e, 'unsync', options, PLATFORM.SQUEEZEBOX);
case PLATFORM.MEDIAPLAYER:
case PLATFORM.SONOS:
return this.callService(
e,
'unjoin',
{
entity_id: entity,
},
platform,
PLATFORM.MEDIAPLAYER,
);
case PLATFORM.HEOS:
return this.callService(
Expand Down