Skip to content

Commit ea4ea56

Browse files
committed
[ 1.0.33 ] * This release requires the SpotifyPlus Integration v1.0.86+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
* Added support for Google Chromecast devices. * Moved support for Sonos devices to the underlying `spotifywebapiPython` package. * Added support for new Zeroconf discovery process, in support of Chromecast devices. * Updated underlying `spotifywebapiPython` package requirement to version 1.0.156. * Updated underlying `smartinspectPython` package requirement to version 3.0.34.
1 parent 3bce59c commit ea4ea56

35 files changed

+435
-334
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ Change are listed in reverse chronological order (newest to oldest).
66

77
<span class="changelog">
88

9+
###### [ 1.0.33 ] - 2025/01/23
10+
11+
* This release requires the SpotifyPlus Integration v1.0.86+ release; please make sure you update the SpotifyPlus integration prior to updating this SpotifyPlus Card release.
12+
* Added support for Google Chromecast devices.
13+
* Moved support for Sonos devices to the underlying `spotifywebapiPython` package.
14+
* Added support for new Zeroconf discovery process, in support of Chromecast devices.
15+
* Updated underlying `spotifywebapiPython` package requirement to version 1.0.156.
16+
* Updated underlying `smartinspectPython` package requirement to version 3.0.34.
17+
918
###### [ 1.0.32 ] - 2025/01/17
1019

1120
* Fixed issue with random track playing if shuffle mode was on while selecting a track favorite. To fix, I had to disable shuffle prior to starting play of the track as the Spotify Web API would always play a shuffled track. The only other alternative was to just play 1 track, which would then end play when the song ended.

src/components/album-actions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,22 +481,22 @@ class AlbumActions extends FavActionsBase {
481481
// call service based on requested action, and refresh affected action component.
482482
if (action == Actions.AlbumFavoriteAdd) {
483483

484-
await this.spotifyPlusService.SaveAlbumFavorites(this.player.id, this.mediaItem.id);
484+
await this.spotifyPlusService.SaveAlbumFavorites(this.player, this.mediaItem.id);
485485
this.updateActions(this.player, [Actions.AlbumFavoriteUpdate]);
486486

487487
} else if (action == Actions.AlbumFavoriteRemove) {
488488

489-
await this.spotifyPlusService.RemoveAlbumFavorites(this.player.id, this.mediaItem.id);
489+
await this.spotifyPlusService.RemoveAlbumFavorites(this.player, this.mediaItem.id);
490490
this.updateActions(this.player, [Actions.AlbumFavoriteUpdate]);
491491

492492
} else if (action == Actions.ArtistFavoriteAdd) {
493493

494-
await this.spotifyPlusService.FollowArtists(this.player.id, uriIdArtist);
494+
await this.spotifyPlusService.FollowArtists(this.player, uriIdArtist);
495495
this.updateActions(this.player, [Actions.ArtistFavoriteUpdate]);
496496

497497
} else if (action == Actions.ArtistFavoriteRemove) {
498498

499-
await this.spotifyPlusService.UnfollowArtists(this.player.id, uriIdArtist);
499+
await this.spotifyPlusService.UnfollowArtists(this.player, uriIdArtist);
500500
this.updateActions(this.player, [Actions.ArtistFavoriteUpdate]);
501501

502502
} else {
@@ -552,7 +552,7 @@ class AlbumActions extends FavActionsBase {
552552
const limit_total = this.mediaItem.total_tracks;
553553

554554
// call service to retrieve album tracks.
555-
this.spotifyPlusService.GetAlbumTracks(player.id, this.mediaItem.id, 0, 0, null, limit_total)
555+
this.spotifyPlusService.GetAlbumTracks(player, this.mediaItem.id, 0, 0, null, limit_total)
556556
.then(tracks => {
557557

558558
// stash the result into state, and resolve the promise.
@@ -580,7 +580,7 @@ class AlbumActions extends FavActionsBase {
580580
const promiseCheckAlbumFavorites = new Promise((resolve, reject) => {
581581

582582
// call service to retrieve favorite setting.
583-
this.spotifyPlusService.CheckAlbumFavorites(player.id, this.mediaItem.id)
583+
this.spotifyPlusService.CheckAlbumFavorites(player, this.mediaItem.id)
584584
.then(result => {
585585

586586
// load results, and resolve the promise.
@@ -609,7 +609,7 @@ class AlbumActions extends FavActionsBase {
609609
const promiseCheckArtistFavorites = new Promise((resolve, reject) => {
610610

611611
// call service to retrieve favorite setting.
612-
this.spotifyPlusService.CheckArtistsFollowing(player.id, this.mediaItem.artists[0].id)
612+
this.spotifyPlusService.CheckArtistsFollowing(player, this.mediaItem.artists[0].id)
613613
.then(result => {
614614

615615
// load results, and resolve the promise.

src/components/artist-actions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,12 @@ class ArtistActions extends FavActionsBase {
390390
// call service based on requested action, and refresh affected action component.
391391
if (action == Actions.ArtistFavoriteAdd) {
392392

393-
await this.spotifyPlusService.FollowArtists(this.player.id, this.mediaItem.id);
393+
await this.spotifyPlusService.FollowArtists(this.player, this.mediaItem.id);
394394
this.updateActions(this.player, [Actions.ArtistFavoriteUpdate]);
395395

396396
} else if (action == Actions.ArtistFavoriteRemove) {
397397

398-
await this.spotifyPlusService.UnfollowArtists(this.player.id, this.mediaItem.id);
398+
await this.spotifyPlusService.UnfollowArtists(this.player, this.mediaItem.id);
399399
this.updateActions(this.player, [Actions.ArtistFavoriteUpdate]);
400400

401401
} else {
@@ -449,7 +449,7 @@ class ArtistActions extends FavActionsBase {
449449
const promiseGetArtistInfo = new Promise((resolve, reject) => {
450450

451451
// call service to retrieve artist info.
452-
this.spotifyPlusService.GetArtistInfo(player.id, this.mediaItem.id)
452+
this.spotifyPlusService.GetArtistInfo(player, this.mediaItem.id)
453453
.then(info => {
454454

455455
// stash the result into state, and resolve the promise.
@@ -486,7 +486,7 @@ class ArtistActions extends FavActionsBase {
486486
const promiseCheckArtistFavorites = new Promise((resolve, reject) => {
487487

488488
// call service to retrieve favorite setting.
489-
this.spotifyPlusService.CheckArtistsFollowing(player.id, this.mediaItem.id)
489+
this.spotifyPlusService.CheckArtistsFollowing(player, this.mediaItem.id)
490490
.then(result => {
491491

492492
// load results, and resolve the promise.

src/components/audiobook-actions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ class AudiobookActions extends FavActionsBase {
303303
// call service based on requested action, and refresh affected action component.
304304
if (action == Actions.AudiobookFavoriteAdd) {
305305

306-
await this.spotifyPlusService.SaveAudiobookFavorites(this.player.id, this.mediaItem.id);
306+
await this.spotifyPlusService.SaveAudiobookFavorites(this.player, this.mediaItem.id);
307307
this.updateActions(this.player, [Actions.AudiobookFavoriteUpdate]);
308308

309309
} else if (action == Actions.AudiobookFavoriteRemove) {
310310

311-
await this.spotifyPlusService.RemoveAudiobookFavorites(this.player.id, this.mediaItem.id);
311+
await this.spotifyPlusService.RemoveAudiobookFavorites(this.player, this.mediaItem.id);
312312
this.updateActions(this.player, [Actions.AudiobookFavoriteUpdate]);
313313

314314
} else {
@@ -365,7 +365,7 @@ class AudiobookActions extends FavActionsBase {
365365
const limit_total = 200;
366366

367367
// call service to retrieve audiobook chapters.
368-
this.spotifyPlusService.GetAudiobookChapters(player.id, this.mediaItem.id, 0, 0, market, limit_total)
368+
this.spotifyPlusService.GetAudiobookChapters(player, this.mediaItem.id, 0, 0, market, limit_total)
369369
.then(chapters => {
370370

371371
// stash the result into state, and resolve the promise.
@@ -393,7 +393,7 @@ class AudiobookActions extends FavActionsBase {
393393
const promiseCheckAudiobookFavorites = new Promise((resolve, reject) => {
394394

395395
// call service to retrieve favorite setting.
396-
this.spotifyPlusService.CheckAudiobookFavorites(player.id, this.mediaItem.id)
396+
this.spotifyPlusService.CheckAudiobookFavorites(player, this.mediaItem.id)
397397
.then(result => {
398398

399399
// load results, and resolve the promise.

src/components/device-actions.ts

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class DeviceActions extends FavActionsBase {
6464
}
6565

6666
// set Spotify Connect device list status indicator.
67-
const deviceListClass = (this.deviceInfo?.DeviceInfo.IsInDeviceList) ? "device-list-in" : "device-list-out";
67+
const deviceListClass = (this.deviceInfo?.IsInDeviceList) ? "device-list-in" : "device-list-out";
6868

6969
// define dropdown menu actions - artist.
7070
const actionsDeviceHtml = html`
@@ -99,9 +99,14 @@ class DeviceActions extends FavActionsBase {
9999
</div>
100100
<div class="media-info-text-ms">${this.deviceInfo?.DeviceInfo.BrandDisplayName}</div>
101101
<div class="media-info-text-s">${this.deviceInfo?.DeviceInfo.ModelDisplayName}</div>
102-
${(this.deviceInfo?.DeviceInfo.IsBrandSonos) ? html`
102+
${(this.deviceInfo?.IsSonos) ? html`
103103
<div class="media-info-text-s padT">
104-
Sonos devices will not appear in Spotify Web API device list
104+
Sonos device (will not appear in Spotify Web API device list)
105+
</div>
106+
` : ""}
107+
${(this.deviceInfo?.IsChromeCast) ? html`
108+
<div class="media-info-text-s padT">
109+
Chromecast device
105110
</div>
106111
` : ""}
107112
</div>
@@ -140,7 +145,7 @@ class DeviceActions extends FavActionsBase {
140145
<div class="grid-action-info-text-s">${this.deviceInfo?.DiscoveryResult.IsDynamicDevice}</div>
141146
142147
<div class="grid-action-info-hdr-s">Is in Device List?</div>
143-
<div class="grid-action-info-text-s ${deviceListClass}">${this.deviceInfo?.DeviceInfo.IsInDeviceList}</div>
148+
<div class="grid-action-info-text-s ${deviceListClass}">${this.deviceInfo?.IsInDeviceList}</div>
144149
145150
<div class="grid-action-info-hdr-s">Auth Token Type</div>
146151
<div class="grid-action-info-text-s copy2cb" @click=${copyToClipboard}>${this.deviceInfo?.DeviceInfo.TokenType}</div>
@@ -256,11 +261,17 @@ class DeviceActions extends FavActionsBase {
256261
this.alertInfoSet("Dynamic devices cannot be managed.");
257262
this.progressHide();
258263

264+
} else if (this.mediaItem.IsChromeCast) {
265+
266+
// chromecast devices do not support Spotify Connect Connect.
267+
this.alertInfoSet("Chromecast devices do not support Spotify Connect connect.");
268+
this.progressHide();
269+
259270
} else {
260271

261272
// connect the device.
262273
this.alertInfoSet("Connecting to Spotify Connect device ...");
263-
await this.spotifyPlusService.ZeroconfDeviceConnect(this.player.id, this.mediaItem, null, null, null, true, true, 1.0);
274+
await this.spotifyPlusService.ZeroconfDeviceConnect(this.player, this.mediaItem, null, null, null, true, true, 1.0);
264275
this.alertInfoSet("Spotify Connect device should be connected.");
265276
this.updateActions(this.player, [Actions.DeviceGetInfo]);
266277

@@ -274,6 +285,12 @@ class DeviceActions extends FavActionsBase {
274285
this.alertInfoSet("Dynamic devices cannot be managed.");
275286
this.progressHide();
276287

288+
} else if (this.mediaItem.IsChromeCast) {
289+
290+
// chromecast does not support Spotify Connect disconnect.
291+
this.alertInfoSet("Chromecast devices do not support Spotify Connect disconnect.");
292+
this.progressHide();
293+
277294
} else if (this.mediaItem.DeviceInfo.BrandDisplayName == 'librespot') {
278295

279296
// librespot does not support Spotify Connect disconnect.
@@ -284,7 +301,7 @@ class DeviceActions extends FavActionsBase {
284301

285302
// disconnect the device.
286303
this.alertInfoSet("Disconnecting from Spotify Connect device ...");
287-
await this.spotifyPlusService.ZeroconfDeviceDisconnect(this.player.id, this.mediaItem, 1.0);
304+
await this.spotifyPlusService.ZeroconfDeviceDisconnect(this.player, this.mediaItem, 1.0);
288305
this.alertInfoSet("Spotify Connect device was disconnected.");
289306
this.updateActions(this.player, [Actions.DeviceGetInfo]);
290307

@@ -348,7 +365,7 @@ class DeviceActions extends FavActionsBase {
348365
const activate_device = false;
349366

350367
// get Spotify Connect device info.
351-
this.spotifyPlusService.GetSpotifyConnectDevice(player.id, this.mediaItem.Id, null, null, refresh_device_list, activate_device)
368+
this.spotifyPlusService.GetSpotifyConnectDevice(player, this.mediaItem.Id, null, null, refresh_device_list, activate_device)
352369
.then(device => {
353370

354371
// clear certain info messsages if they are temporary.

src/components/episode-actions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,22 @@ class EpisodeActions extends FavActionsBase {
347347
// call service based on requested action, and refresh affected action component.
348348
if (action == Actions.EpisodeFavoriteAdd) {
349349

350-
await this.spotifyPlusService.SaveEpisodeFavorites(this.player.id, this.episode?.id);
350+
await this.spotifyPlusService.SaveEpisodeFavorites(this.player, this.episode?.id);
351351
this.updateActions(this.player, [Actions.EpisodeFavoriteUpdate]);
352352

353353
} else if (action == Actions.EpisodeFavoriteRemove) {
354354

355-
await this.spotifyPlusService.RemoveEpisodeFavorites(this.player.id, this.episode?.id);
355+
await this.spotifyPlusService.RemoveEpisodeFavorites(this.player, this.episode?.id);
356356
this.updateActions(this.player, [Actions.EpisodeFavoriteUpdate]);
357357

358358
} else if (action == Actions.ShowFavoriteAdd) {
359359

360-
await this.spotifyPlusService.SaveShowFavorites(this.player.id, this.episode?.show.id);
360+
await this.spotifyPlusService.SaveShowFavorites(this.player, this.episode?.show.id);
361361
this.updateActions(this.player, [Actions.ShowFavoriteUpdate]);
362362

363363
} else if (action == Actions.ShowFavoriteRemove) {
364364

365-
await this.spotifyPlusService.RemoveShowFavorites(this.player.id, this.episode?.show.id);
365+
await this.spotifyPlusService.RemoveShowFavorites(this.player, this.episode?.show.id);
366366
this.updateActions(this.player, [Actions.ShowFavoriteUpdate]);
367367

368368
} else {
@@ -439,7 +439,7 @@ class EpisodeActions extends FavActionsBase {
439439
const promiseEpisodeUpdate = new Promise((resolve, reject) => {
440440

441441
// call service to retrieve media item that is currently selected.
442-
this.spotifyPlusService.GetEpisode(player.id, this.mediaItem.id)
442+
this.spotifyPlusService.GetEpisode(player, this.mediaItem.id)
443443
.then(result => {
444444

445445
// load results, update favorites, and resolve the promise.
@@ -472,7 +472,7 @@ class EpisodeActions extends FavActionsBase {
472472
const promiseCheckShowFavorites = new Promise((resolve, reject) => {
473473

474474
// call service to retrieve favorite setting.
475-
this.spotifyPlusService.CheckShowFavorites(player.id, this.episode?.show.id)
475+
this.spotifyPlusService.CheckShowFavorites(player, this.episode?.show.id)
476476
.then(result => {
477477

478478
// load results, and resolve the promise.
@@ -501,7 +501,7 @@ class EpisodeActions extends FavActionsBase {
501501
const promiseCheckEpisodeFavorites = new Promise((resolve, reject) => {
502502

503503
// call service to retrieve favorite setting.
504-
this.spotifyPlusService.CheckEpisodeFavorites(player.id, this.episode?.id)
504+
this.spotifyPlusService.CheckEpisodeFavorites(player, this.episode?.id)
505505
.then(result => {
506506

507507
// load results, and resolve the promise.

src/components/fav-actions-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export class FavActionsBase extends LitElement {
232232
this.progressShow();
233233

234234
// add media item to play queue.
235-
await this.spotifyPlusService.AddPlayerQueueItems(this.player.id, mediaItem.uri, null, false);
235+
await this.spotifyPlusService.AddPlayerQueueItems(this.player, mediaItem.uri);
236236

237237
}
238238
catch (error) {

src/components/player-body-audiobook.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,22 +372,22 @@ export class PlayerBodyAudiobook extends PlayerBodyBase {
372372
// call service based on requested action, and refresh affected action component.
373373
if (action == Actions.AudiobookFavoriteAdd) {
374374

375-
await this.spotifyPlusService.SaveAudiobookFavorites(this.player.id, this.chapter?.audiobook.id);
375+
await this.spotifyPlusService.SaveAudiobookFavorites(this.player, this.chapter?.audiobook.id);
376376
this.updateActions(this.player, [Actions.AudiobookFavoriteUpdate]);
377377

378378
} else if (action == Actions.AudiobookFavoriteRemove) {
379379

380-
await this.spotifyPlusService.RemoveAudiobookFavorites(this.player.id, this.chapter?.audiobook.id);
380+
await this.spotifyPlusService.RemoveAudiobookFavorites(this.player, this.chapter?.audiobook.id);
381381
this.updateActions(this.player, [Actions.AudiobookFavoriteUpdate]);
382382

383383
} else if (action == Actions.ChapterFavoriteAdd) {
384384

385-
await this.spotifyPlusService.SaveEpisodeFavorites(this.player.id, this.chapter?.id);
385+
await this.spotifyPlusService.SaveEpisodeFavorites(this.player, this.chapter?.id);
386386
this.updateActions(this.player, [Actions.ChapterFavoriteUpdate]);
387387

388388
} else if (action == Actions.ChapterFavoriteRemove) {
389389

390-
await this.spotifyPlusService.RemoveEpisodeFavorites(this.player.id, this.chapter?.id);
390+
await this.spotifyPlusService.RemoveEpisodeFavorites(this.player, this.chapter?.id);
391391
this.updateActions(this.player, [Actions.ChapterFavoriteUpdate]);
392392

393393
} else {
@@ -448,7 +448,7 @@ export class PlayerBodyAudiobook extends PlayerBodyBase {
448448
const uriIdMediaItem = getIdFromSpotifyUri(this.player.attributes.media_content_id);
449449

450450
// call service to retrieve media item that is currently playing.
451-
this.spotifyPlusService.GetChapter(player.id, uriIdMediaItem)
451+
this.spotifyPlusService.GetChapter(player, uriIdMediaItem)
452452
.then(result => {
453453

454454
// load results, update favorites, and resolve the promise.
@@ -481,7 +481,7 @@ export class PlayerBodyAudiobook extends PlayerBodyBase {
481481
const promiseCheckAudiobookFavorites = new Promise((resolve, reject) => {
482482

483483
// call service to retrieve favorite setting.
484-
this.spotifyPlusService.CheckAudiobookFavorites(player.id, this.chapter?.audiobook.id)
484+
this.spotifyPlusService.CheckAudiobookFavorites(player, this.chapter?.audiobook.id)
485485
.then(result => {
486486

487487
// load results, and resolve the promise.
@@ -510,7 +510,7 @@ export class PlayerBodyAudiobook extends PlayerBodyBase {
510510
const promiseCheckEpisodeFavorites = new Promise((resolve, reject) => {
511511

512512
// call service to retrieve favorite setting.
513-
this.spotifyPlusService.CheckEpisodeFavorites(player.id, this.chapter?.id)
513+
this.spotifyPlusService.CheckEpisodeFavorites(player, this.chapter?.id)
514514
.then(result => {
515515

516516
// load results, and resolve the promise.

src/components/player-body-queue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export class PlayerBodyQueue extends PlayerBodyBase {
228228
setTimeout(() => {
229229

230230
// play the selected track, as well as the remaining tracks.
231-
this.spotifyPlusService.PlayerMediaPlayTracks(this.player.id, uris.join(","));
231+
this.spotifyPlusService.PlayerMediaPlayTracks(this.player, uris.join(","));
232232

233233
// hide progress indicator.
234234
this.progressHide();
@@ -294,7 +294,7 @@ export class PlayerBodyQueue extends PlayerBodyBase {
294294
const promiseGetPlayingItem = new Promise((resolve, reject) => {
295295

296296
// call service to retrieve media item that is currently playing.
297-
this.spotifyPlusService.GetPlayerQueueInfo(player.id)
297+
this.spotifyPlusService.GetPlayerQueueInfo(player)
298298
.then(result => {
299299

300300
// load results, update favorites, and resolve the promise.

0 commit comments

Comments
 (0)