Skip to content

Commit

Permalink
Adjust for breaking Sonos change in HA 2022.5 (#656)
Browse files Browse the repository at this point in the history
* Adjust for breaking Sonos change in HA 2022.5

* Changes from review

* TS version fix
  • Loading branch information
spacegaier authored May 5, 2022
1 parent c493311 commit 6c87eb7
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit 6c87eb7

Please sign in to comment.