All notable changes to this project are listed here.
Change are listed in reverse chronological order (newest to oldest).
UpdateActiveDevice
- Updated trace message to better reflect logic flow.
- Added
SpotifyConnectDevices.UpdateActiveDevice
method to update the currently active device based on playerState. - Added
ZeroconfDiscoveryResult.Description
property that returns a basic description of the device, and how source info was obtained. This is a helper property, and not part of the Zeroconf ServiceInfo result.
- Added
SpotifyConnectDevices.RemoveDevice
method to remove existing device entry(s) from theItems
collection by device id value.
- Added
SpotifyConnectDevices.GetActiveDevice
method to return a Spotify Connect device if one is currently marked as the active device; otherwise, null if there is no active device. - Updated
SpotifyConnectDevices.UpdatePlayerDevices
method to return the currently active Spotify Player device instance as determined by the Spotify Player PlayState if one was supplied; otherwise, null if not active device.
- Added
SpotifyConnectDevices.UpdatePlayerDevices
method to add a list of dynamic player device entries to theItems
collection, remove any existing dynamic devices from the collection that are not in theplayerDevices
list, and update the currently active device based on playerState.
- Added
SpotifyConnectDevices.GetDeviceIndexByDiscoveryName
method to return the index of theItems
collection entry that contains the specified device Zeroconf discovery results name value, or -1 if not found.
- Added
ZeroconfDiscoveryResult.Equals
method to compare object argument values to determine equality. - Added
ZeroconfGetInfo.Equals
method to compare object argument values to determine equality. - Added
SpotifyConnectDevice.Equals
method to compare object argument values to determine equality.
- Added
SpotifyConnectDevices.GetDeviceByDiscoveryKey
method to return the device of theItems
collection entry that contains the specified device Zeroconf discovery results key value, or null if not found.
- Added
SpotifyConnectDevices.GetDeviceIndexByDiscoveryKey
method to return the index of theItems
collection entry that contains the specified device Zeroconf discovery results key value, or -1 if not found.
- Updated
SpotifyDiscovery._OnServiceStateChange
method to correctly update the Zeroconf DiscoveryResults instance. The serviceinfoKey
value must be used to update the device entry (not itsId
value).
- Updated
SpotifyDiscovery._OnServiceStateChange
method to correctly update the Zeroconf DiscoveryResults instance.
- Added
PlayerPlayState.IsEmpty
property setter.
- Updated
SpotifyClient.PlayerTransferPlayback
method to check player state before trying to transfer playback. If nothing is playing, then issue a call toPlayTrackFavorites
instead. This will avoid theRestriction violated
error which results from a transfer playback to the player when nothing is currently playing.
- Updated
SpotifyClient
class to include properties forSpotifyConnectLoginId
andSpotifyConnectUsername
.
- Updated
SpotifyClient
methodsPlayerActivateDevices
andGetSpotifyConnectDevice
to re-create the ZeroconfConnect connection instance if the device IP address or port changed after Zeroconf rediscovery on a Disconnect call sequence.
- Modified
SpotifyDiscovery._OnServiceStateChange
method to process Zeroconf Update and Remove notifications.
- Modified
ZeroconfConnect.GetInformation
method logic to automatically retry the connection (after 250ms, 2s max) to the Spotify Connect Zeroconf device service if a "connection refused" was returned while trying to get device information. This was originally set to 10 seconds, which is far too long to wait for a device to become available. - Updated
SpotifyClient
methodsPlayerActivateDevices
andGetSpotifyConnectDevice
to rediscover the Spotify Connect Zeroconf device after a Disconnect call is issued. It has been found that some device manufacturers (e.g. Denon) stop and restart the Zeroconf server on the device after aresetUsers
(e.g. disconnect) call is made, which changes the IP Port number that the device listens on for incoming connections. - Removed the deprecated function
SpotifyConnect.PlayerResolveDeviceId
(since 2024/08/15); use theGetSpotifyConnectDevice
method instead.
- Modified
ZeroconfConnect.GetInformation
method logic to automatically retry the connection (after 250ms, 10s max) to the Spotify Connect Zeroconf device service if a "connection refused" was returned while trying to get device information. The previous logic used a simple delay prior to the call and did not retry the connection, which resulted in the "connection refused" exceptions while trying to awaken devices. Some Spotify Connect devices take a little bit longer to start accepting connections again after a change. - Added
lxml
package requirement tosetup.py
.
- Added
PlayerPlayState.IsEmpty
property; returns True if Spotify playstate returned an empty response; otherwise, false. This is a helper property, and is not part of the Spotify Web API specification.
- Added
SpotifyClient.GetCoverImageFile
that gets the contents of an image url and transfers the contents to the local file system. This method should only be used to download images for playlists that contain public domain images. - Added
ImageObject.GetImageHighestResolutionWidth
that returns the highest resolution order image width from a list ofImageObject
items.
- Updated
PlayerActions
model to load the correct action values forTogglingRepeatTrack
andTogglingShuffle
. These were switched, which was causing shuffle and repeat actions to be misinterpreted.
- Updated
SpotifyClient.PlayerMediaPlayTrackFavorites
to default and validate limitTotal argument. It has been found that approximately 750 items can be retrieved and played successfully (anything more generates request size errors).
- Updated
SpotifyClient.PlayerMediaPlayTrackFavorites
to retrieve unsorted track favorites, so that the most recently added favorites are played instead of the first alphabetical favorites.
- Added
PlaylistSimplified
property setters for the the following properties:Description
,Id
,Name
,Type
,Uri
.
- Updated various
SpotifyClient
methods to discard favorites that do not contain a valid URI value. Sometimes the Spotify Web API returns favorite items with no information! The following methods were updated:GetAlbumFavorites
,GetEpisodeFavorites
,GetShowFavorites
,GetTrackFavorites
.
- Updated various methods to validate boolean arguments - if value was not passed (e.g. None), then set to documented value (True or False).
- Fixed a bug in
SpotifyClient.PlayerTransferPlayback
method that was causing play not to resume ifPlay=True
andforceActivateDevice=True
. If forceActivateDevice=True, then we need to resume play manually if play=True was specified; this is due to the device losing its current status since it was being forcefully activated (e.g. disconnected and reconnected).
- Updated
SpotifyClient
methods to return an exception due to the functions being deprecated by the Spotify development team. More information can be found on the Spotify Developer Forum Blog post that was conveyed on November 27, 2024. The following methods will now raise aSpotifyApiError
exception due to the Spotify development team changes:GetArtistRelatedArtists
,GetTrackRecommendations
,GetTrackAudioFeatures
,GetFeaturedPlaylists
,GetCategoryPlaylists
,GetGenres
. The following properties were also marked as deprecated for the same reason:TrackSimplified.PreviewUrl
. - Due to the above chnages made by Spotify, any Algorithmic and Spotify-owned editorial playlists are no longer accessible or have more limited functionality. This means that you can no longer obtain details via the
SpotifyClient.GetPlaylist
andSpotifyClient.GetPlaylistItems
methods for Spotify-owned / generated content (e.g. "Made For You", etc). A404 - Not Found
error will be returned when trying to retrieve information for these playlist types.
- Updated
AuthTokenGenerator.py
sample code to correctly reference the token cache file.
- Updated
SpotifyClient.ReorderPlaylistItems
to validate required input parameters were supplied. - Updated
SpotifyClient.ReplacePlaylistItems
to check for no uris argument; this can occur if you want to clear the playlist. - Updated
SpotifyClient.GetPlaylistCoverImage
method to make theplaylistId
argument optional; if not supplied, the currently playing playlist id value is used instead. - Added
SpotifyClient.Version
property.
- Updated
TrackRecommendations
model to return empty arrays (instead of None) if seeds or tracks items were not found.
- Updated
SpotifyClient.GetArtistInfo
method to handle thesee more
suffix in theBioHtml
property. - Updated
SpotifyClient.GetArtistInfo
method to correctly parse tour event dates.
- Updated
SpotifyClient.GetArtistInfo
method to force all links in theBioHtml
property to open in a new browser window / tab (e.g. addedtarget="_blank"
).
- Updated
ArtistInfoTourEvent
model to include the concert link. - Fixed
SpotifyClient.GetArtistInfo
method to correctly parse Spotify artist info and tour events.
- Updated
PlayerQueueInfo
model to include theDateLastRefreshed
property, which contains the date and time items were was last refreshed in unix epoch format (e.g. 1669123919.331225). A value of zero indicates the date was unknown. Note that this attribute does not exist in the Spotify Web API; it was added here for convenience. - Updated
Category
model to include theType
property, which contains a simulated data type. This is a helper property - no value with this name is returned from the Spotify Web API. - Updated
Category
model to add theuri
andtype
values to data returned by theToDictionary
method.
- Added
sortResult
argument to the followingSpotifyClient
methods:GetArtistRelatedArtists
,GetArtistTopTracks
. If True (default), result items are sorted by name prior to returning to the caller; otherwise, results are left in the order that the Spotify Web API returned them.
- Updated
PlayerQueueInfo
model to remove repeated items when retrieving player queue information. For some reason, the Spotify Web API will return up to 10 duplicate items with the same information. For example: if there is only 1 item in the queue, then 10 duplicate items are returned by the Spotify Web API; if there are 5 items in the queue, then 5 duplicate items are returned by the Spotify Web API. We will check for this scenario, and only return non-duplicate items if so. - Updated
PageObject
model to include theDateLastRefreshed
property, which contains the date and time items were was last refreshed in unix epoch format (e.g. 1669123919.331225). A value of zero indicates the date was unknown. Note that this attribute does not exist in the Spotify Web API; it was added here for convenience. - Added
SpotifyClient.AddPlayerQueueItems
method that will add one or more items to the end of the user's current playback queue. - Marked
SpotifyClient.AddPlayerQueueItem
method as deprecated; use the newAddPlayerQueueItems
method instead.
- Updated
SpotifyClient.GetSpotifyConnectDevice
method to issue a slight delay after disconnecting the device. This should preventGetinformation
exceptions for devices that require a little bit of extra time after a Disconnect (e.g. zeroconfresetUsers
) request in order to be ready for a Connect (e.g. zeroconfaddUser
) request.
- Updated
SpotifyClient.GetChapter
method to make thechapterId
argument optional; if not supplied, the currently playing chapter id value is used instead.
- Updated
ImageObject.GetImageHighestResolution
method to account for null width values.
- Correctly Updated various methods that return an ImageUrl property to return the highest resolution image from the Images collection instead of the first image. For some reason, the Spotify Web API sets the first Images collection image to the lowest resolution (e.g. 64x64); for all other Images, the highest resolution image is listed first (e.g. 640x640).
- Updated various methods that return an ImageUrl property to return the highest resolution image from the Images collection instead of the first image. For some reason, the Spotify Web API sets the first Images collection image to the lowest resolution (e.g. 64x64); for all other Images, the highest resolution image is listed first (e.g. 640x640).
- Updated
SpotifyClient.RemoveShowFavorites
method to account for Spotify Web API changes to remove show favorites. - Updated
SpotifyClient.SaveShowFavorites
method to account for Spotify Web API changes to save show favorites. - Updated
SpotifyClient.CheckPlaylistFollowers
method to account for Spotify Web API changes touserIds
argument, which is now deprecated. A single item list containing current user's Spotify Username must now be used.
- Fixed various python
SyntaxWarning: invalid escape sequence '\ '
warnings that were being generated when code was executed. Something changed with Home Assistant recently that turned these "used to be ignored" warnings into actual warnings that wind up in the HA System Log! This is due to invalid escaped characters in various string comments that are used for documentation purposes (e.g. """ this is a code comment """).
- Updated Spotify Connect device processing to only require the userid and password parameters when authenticating to devices that require user and password values. Some devices only require a loginid value (e.g. spotifyd, Spotify Connect AddOn, librespot, Sonos, etc). The user should not have to specify userid and password values if they are not required!
- Cleaned up some documentation, as well as some of the code examples.
- Updated
SpotifyClient.PlayerMediaSeek
method to change theprogressMS
check to<= 0
when invoking relative positioning.
- Updated
SpotifyClient.PlayerMediaSeek
method to add relative positioning capability. This allows you to seek ahead / behind by a specifiedrelativePositionMS
positioning amount. ThepositionMS
argument must be zero to enable this functionality. Note that the relative position functionality is not defined by the Spotify Web API. The functionality was added to this API to support "skip" seeking.
- Updated
SpotifyClient.GetShowFavorites
method to only return podcast show items by default. Prior to this fix, it was returning both audiobook and podcast shows. The newexcludeAudiobooks
argument allows you to return both audiobook and podcast shows (default returned by Spotify Web API).
- Updated
ZeroconfConnect.Connect
method to load authorization credentials for the Spotify ConnectaddUser
blob from acredentials.json
file for devices that utilize librespot / spotifyd. Spotify no longer supports uername / password authentication via librespot (always returns "Bad Credentials" exceptions. This allows the librespotcredentials.json
file to be copied to the spotifywebapiPython storage folder, and used for calls to the librespotaddUser
zeroconf endpoint. - Updated
SpotifyClient.GetSpotifyConnectDevice
andPlayerActivateDevices
methods to bypass the call to Spotify Connect Zeroconf Disconnect for devices that utilize librespot / spotifyd. librespot does not implement the Spotify Connect ZeroconfresetUsers
endpoint, so the request always fails with a 404.
- Updated
SpotifyClient.GetSpotifyConnectDevice
method to force a Spotify Connect Disconnect call to the device ifactivateDevice
argument isTrue
. TheverifyUserContext
argument is deprecated as well. This was necessary, as Spotify Connect device manufacturers do not use the Spotify Connect Zeroconf InformationActiveUser
property consistently. - Added
PlayerTransferPlayback.forceActivateDevice
argument that allows you to force activate the Spotify Connect device as part of the transfer of playback.
- Added
PlayerPlayState.ItemType
property that denotes the type of episode being played:podcast
oraudiobook
. This property is only loaded when theSpotifyClient
GetPlayerNowPlaying
orGetPlayerPlaybackState
method is called withadditionalTypes='episode'
.
- Added
SpotifyClient.IsAudiobookEpisode
method that returns true if the specified episode id is an audiobook chapter; otherwise, false. This allows you to programatically determine the difference between a podcast / show episode, and an audiobook episode.
- Updated
ZeroconfGetInfoAlias
to fix a bug related to Spotify Connect devices that define aliases (introduced with v1.0.93). This was causingTypeError: unsupported operand type(s) for &: 'str' and 'tuple'
exceptions if a device had aliases defined.
- Added defensive code in various parsers to account for the Spotify Web API returning an invalid / incomplete object. This was noticed with the
GetAlbumFavorites
method, but also applied to other models that inherited from PageObject.
- Added
image_url
attribute value to all models that support aToDictionary()
method (some that were previously missed in 1.0.94 release).
- Added
image_url
attribute value to all models that support aToDictionary()
method. - Miscellaneous documentation updates.
- Updated
SpotifyClient.GetAlbumFavorites
method to correctly sort results based upon thesortResult
argument setting; true to sort by name ascending, false to sort by AddedAt descending. - Updated
SpotifyClient.GetEpisodeFavorites
method to correctly sort results based upon thesortResult
argument setting; true to sort by name ascending, false to sort by AddedAt descending. - Updated
SpotifyClient.GetShowFavorites
method to correctly sort results based upon thesortResult
argument setting; true to sort by name ascending, false to sort by AddedAt descending. - Updated
SpotifyClient.GetTrackFavorites
method to correctly sort results based upon thesortResult
argument setting; true to sort by name ascending, false to sort by AddedAt descending.
- Updated
SpotifyClient.FollowPlaylist
method to make theplaylistId
argument optional; if not supplied, the currently playing playlist id value is used instead. - Updated
SpotifyClient.GetAlbum
method to make thealbumId
argument optional; if not supplied, the currently playing album id value is used instead. - Updated
SpotifyClient.GetAlbumTracks
method to make thealbumId
argument optional; if not supplied, the currently playing album id value is used instead. - Updated
SpotifyClient.GetArtist
method to make theartistId
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.GetArtistAlbums
method to make theartistId
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.GetArtistInfo
method to make theartistId
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.GetArtistRelatedArtists
method to make theartistId
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.GetArtistTopTracks
method to make theartistId
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.GetAudiobook
method to make theaudiobookId
argument optional; if not supplied, the currently playing audiobook id value is used instead. - Updated
SpotifyClient.GetAudiobookChapters
method to make theaudiobookId
argument optional; if not supplied, the currently playing audiobook id value is used instead. - Updated
SpotifyClient.GetEpisode
method to make theepisodeId
argument optional; if not supplied, the currently playing episode id value is used instead. - Updated
SpotifyClient.GetPlaylist
method to make theplaylistId
argument optional; if not supplied, the currently playing playlist id value is used instead. - Updated
SpotifyClient.GetPlaylistItems
method to make theplaylistId
argument optional; if not supplied, the currently playing playlist id value is used instead. - Updated
SpotifyClient.GetShow
method to make theshowId
argument optional; if not supplied, the currently playing show id value is used instead. - Updated
SpotifyClient.GetShowEpisodes
method to make theshowId
argument optional; if not supplied, the currently playing show id value is used instead. - Updated
SpotifyClient.GetTrack
method to make thetrackId
argument optional; if not supplied, the currently playing track id value is used instead. - Updated
SpotifyClient.GetTrackAudioFeatures
method to make thetrackId
argument optional; if not supplied, the currently playing track id value is used instead. - Updated
SpotifyClient.UnfollowPlaylist
method to make theplaylistId
argument optional; if not supplied, the currently playing playlist id value is used instead.
- Updated
CheckTrackFavorites
,RemoveTrackFavorites
, andSaveTrackFavorites
methods to ensure that nowplaying item was a track and not an episode item.
- Updated various methods to not log handled exception data as unhandled exceptions.
- Updated
SpotifyClient.CheckAlbumFavorites
method to make theids
argument optional; if not supplied, the currently playing album id value is used instead. - Updated
SpotifyClient.CheckArtistsFollowing
method to make theids
argument optional; if not supplied, the currently playing artist id value is used instead. - Updated
SpotifyClient.CheckAudiobookFavorites
method to make theids
argument optional; if not supplied, the currently playing audiobook id value is used instead. - Updated
SpotifyClient.CheckEpisodeFavorites
method to make theids
argument optional; if not supplied, the currently playing episode id value is used instead. - Updated
SpotifyClient.CheckShowFavorites
method to make theids
argument optional; if not supplied, the currently playing show id value is used instead. - Updated
SpotifyClient.CheckTrackFavorites
method to make theids
argument optional; if not supplied, the currently playing track id value is used instead.
- Updated
SpotifyClient.DefaultDeviceId
property to setter to account for empty string values.
- Added
SpotifyClient.DefaultDeviceId
property to get / set the default device id (or name) to use for player transport methods (e.g. play, pause, skip, etc) that do not specify a device id and there is no active Spotify player detected (e.g. "Office", "5d4931f9d0684b625d702eaa24137b2c1d99539c", etc). This should avoid theNo Active Device
exceptions returned from the Spotify Web API when playback transport methods are called after long pauses of inactivity.
- Updated
SpotifyClient
,ZeroconfConnect
, andAuthClient
class constructors to include thetokenStorageFile
argument that specifies the filename and extension of the authorization Token Cache file. This is used for Spotify Connect devices that utilize theauthorization_code
token type.
- Updated
SpotifyClient.RemoveAudiobookFavorites
method to make theids
argument optional; if not supplied, the currently playing audiobook id value is used instead. - Updated
SpotifyClient.RemoveEpisodeFavorites
method to make theids
argument optional; if not supplied, the currently playing episode id value is used instead. - Updated
SpotifyClient.RemoveShowFavorites
method to make theids
argument optional; if not supplied, the currently playing show id value is used instead. - Updated
SpotifyClient.SaveAudiobookFavorites
method to make theids
argument optional; if not supplied, the currently playing audiobook id value is used instead. - Updated
SpotifyClient.SaveEpisodeFavorites
method to make theids
argument optional; if not supplied, the currently playing episode id value is used instead. - Updated
SpotifyClient.SaveShowFavorites
method to make theids
argument optional; if not supplied, the currently playing show id value is used instead.
- Updated
SpotifyClient.PlayerTransferPlayback
method to default therefreshDeviceList
argument to True so that the Spotify Connect device list is refreshed by default before transferring playback. - Updated
ZeroconfConnect
methods to useconnection:close
headers for requests to the Spotify Connect Zeroconf API endpoints.
- Updated
SpotifyClient.GetSpotifyConnectDevice
method to check if a Spotify Desktop Client Application OAuth2 token exists when a PlayerTransfer targets a Sonos device. If not found, then control will be transferred to the Sonos device using it's local queue; if found, then Spotify Connect will reconnect to the device and control will be transferred to the Sonos device using Spotify Connect.
- Updated
SpotifyClient.GetSpotifyConnectDevice
method to get real-time information for some portions of the device info for devices detected by zeroconf discovery (non-dynamic), even when using the cache. Prior to this fix, transfer of playback failed for dynamic devices (web player, mobile app player, etc).
- Updated
SpotifyClient.GetSpotifyConnectDevice
method to get real-time information for some portions of the device info, even when using the cache. Prior to this, stale information was being used that had been updated since the last cache update.
- Added
SpotifyClient.GetSpotifyConnectDevice
method that will get information about a specific Spotify Connect player device, and (optionally) activate the device if it requires it. - Marked the
SpotifyClient.PlayerResolveDeviceId
method as deprecated, and it will be removed in a future release; use theGetSpotifyConnectDevice
instead. - Removed
SpotifyClient.PlayerTransferPlayback
method argumentresolveDeviceId
as it is no longer used. - Added
SpotifyClient.PlayerTransferPlayback
method argumentrefreshDeviceList
to refresh the Spotify Connect device list (True) or use the Spotify Connect device list cache (False) when resolving a Spotify Connect device value.
- Updated
ZeroconfConnect._GetSpotifyConnectAuthorizationCodeToken
method to raise an exception if the Spotify Client Application authorization access token could not be found. Prior logic was causing the process to wait for a user response to a token authorization request, which would never happen since the process was running on a server.
- Updated
ZeroconfConnect
class constructor to include thetokenStorageDir
argument that specified the directory path that will contain thetokens.json
cache file. This is used for Spotify Connect devices that utilize theauthorization_code
token type.
- Updated
AuthClient.AuthorizeWithServer
method to specify a redirect uri with host, port, and path values. Prior code was only allowing a redirect uri with host and port values. - Added
SpotifyClient.SetAuthTokenAuthorizationCode
method argumentredirectUriPath
to allow a redirect_uri path value to be specified for OAuth authorization requests. - Added
SpotifyClient.SetAuthTokenAuthorizationCodePKCE
method argumentredirectUriPath
to allow a redirect_uri path value to be specified for OAuth authorization requests. - Updated
ZeronconfConnect
class to correctly process Spotify Connect requests for token typeauthorization_code
devices. - Updated
SpotifyClient.PlayerMediaPlayTrackFavorites
method to add thelimitTotal
argument that limits the number of tracks retrieved from favorites. - Added
sortResult
argument to the followingSpotifyClient
methods:GetAlbumFavorites
,GetAlbumNewReleases
,GetArtistAlbums
,GetArtistsFollowed
,GetAudiobookFavorites
,GetBrowseCategorys
,GetCategoryPlaylists
,GetEpisodeFavorites
,GetFeaturedPlaylists
,GetPlayerDevices
,GetPlaylistFavorites
,GetPlaylistsForUser
,GetShowFavorites
,GetSpotifyConnectDevices
,GetTrackFavorites
,GetUsersTopArtists
,GetUsersTopTracks
. If True (default), result items are sorted by name prior to returning to the caller; otherwise, results are left in the order that the Spotify Web API returned them.
- Updated
ZeroconfConnect
class to remove some test code that was accidentally left in place for tokentypeauthorization_code
research.
- Updated
PlayerPlayState.ShuffleState
method to return a boolean True or False value to account for changes to underlying Spotify Web API. - Updated
PlayerPlayState.SmartShuffle
method to return a boolean True or False value to account for changes to underlying Spotify Web API.
- Added
SpotifyConnectDevices.GetDeviceById
method to return aSpotifyConnectDevice
instance if the collection contains the specified device id value; otherwise, None. - Added
SpotifyConnectDevices.GetDeviceByName
method to return aSpotifyConnectDevice
instance if the collection contains the specified device name value; otherwise, None. - Updated
ZeroconfConnect
class to use a '2.7.1' version indicator if no version argument was specified on the class contructor. - Updated
ZeroconfConnect.Disconnect
to check for an invalid JSON response. It has been found that some devices (Sonos, etc) do not return a proper JSON response for theresetUsers
action. If a JSON response was not returned, then it will treat the http status code as the response code; if it's not a 200, then it will raise an exception. - Updated
SpotifyClient.PlayerResolveDeviceId
method to not switch the active user context for Sonos devices. Sonos devices are restricted, and (currently) cannot be controlled by the Spotify Web-Services API player methods.
- Updated
SpotifyClient.GetSpotifyConnectDevices
to gracefully handle device unavailable scenarios. It will try to reach the device by its direct HostIpAddress first; if that fails, then it will try to reach the device by its Server alias; if that fails, then it will log a warning that the device could not be reached and press on. - Updated
ZeroconfConnect.Disconnect
to check for an invalid JSON response. It has been found that some devices (Sonos, etc) do not return a proper JSON response for theresetUsers
action. If a JSON response was not returned, then it will treat the http status code as the response code; if it's not a 200, then it will raise an exception. - Updated
BlobBuilder
methods to add tracing of blob data contents.
- Updated
ZeroconfConnect.Connect
method to handle theauthorization_code
token type for Zeroconf APIaddUser
requests.
- Updated
ZeroconfConnect.Connect
method to properly return the response data from theaddUser
request and process the results.
- Updated
ZeroconfConnect.Connect
method to properly wait for device to become fully availabile if need be.
- Added properties and arguments to support the Zeroconf API
loginId
argument for theaddUser
request. - Updated
ZeroconfConnect.Connect
method to include thedeviceName
anddeviceId
keys for theaddUser
request for certain device manufacturer conditions. - Updated
ZeroconfConnect.Connect
method to not issue a Disconnect to reset the user context if the public key value is "INVALID", as the logic did not work as expected.
- Updated
ZeroconfConnect._CheckResponseForErrors
method to not process the Spotify Zeroconf API response, as each method calling the check response method will process the returned status.
- Updated
SpotifyClient.IsDeviceId
class to recognize UUID-formatted device id's (e.g. "48b677ca-ef9b-516f-b702-93bf2e8c67ba"). - Updated
ZeroconfConnect
class to not default theversion
value to1.0
, in the event that newer devices may not support that version identifier. - Updated
ZeroconfConnect.Connect
method to not pass theloginId
parameter to the request. - Updated
ZeroconfConnect.Connect
method to issue a Disconnect to reset the user context if the public key value is "INVALID".
- Updated
ZeroconfResponse
class to convert thestatus
andspotifyError
values to numeric from string. Some Spotify Connect devices return them as strings, while other return them as numerics.
- Updated
ZeroconfConnect.Connect
method to account for "ERROR-INVALID-PUBLICKEY" statuses returned for some devices. This will retry the connection request with the PublicKey value returned from the initial request.
- Updated
SpotifyClient.GetSpotifyConnectDevices
method to correctly set the currently active device.
- Updated
ZeroconfConnect
class to process the Spotify Zeroconf API status code from the JSON response instead of processing the HTTP request status code. It has been found that some Spotify Connect manufacturers return different HTTP status codes than other manufacturers; but the Spotify Connectstatus
,statusString
andspotifyError
JSON properties seem to be consistent across the board. - Updated
SpotifyClient.GetSpotifyConnectDevices
method to filter out duplicate Spotify Connect Device entries for devices that have been grouped together. For example, the "Bose-ST10-1" and "Bose-ST10-2" are grouped as a stereo pair; there will be two Zeroconf discovery result entries with different instance names, but their Zeroconf getInfo endpoint url will be the same. When this happens, it causes the values to show up as duplicates if we process both of them.
- Updated
SpotifyDiscovery.DiscoverDevices
method to properly free Zeroconf resources after service discovery, and prevent possible memory leaks and crashes due to running out of resources.
- Added
ZeroconfGetInfo.IsInDeviceList
property that returns the status of active device list verification process (Verification not Performed, Verified Active, Verified Inactive).
- Updated
ZeroconfConnect
class to process all responses as JSON responses. It was found that some Spotify Zeroconf API capable devices were not properly setting theContent-Type
in the returned http response header. - Updated
SpotifyDiscovery
class to process the individual Spotify Connect instance names that were discovered via Zeroconf. Prior logic was adding a device for every IPV4 address that was found for an instance, assuming that each instance only contained one IP address; some services contain multiple IP addressess for the same instance name (specifically, theSpotifyConnect
add-on, which runs in a docker container). - Updated
SpotifyDiscovery
class to rename theHostIpv4Address
property (and method arguments) toHostIpAddress
. The address specified in this argument can be an IP address (e.g. "192.168.1.81") or an alias (e.g. "bose.speaker.kitchen"). - Updated
ZeroconfConnect
class to rename theHostIpv4Address
property (and method arguments) toHostIpAddress
. The address specified in this argument can be an IP address (e.g. "192.168.1.81") or an alias (e.g. "bose.speaker.kitchen"). - Updated various
SpotifyClient
methods to utilize the defaultHostIpAddress
(orServer
value if defaultHostIpAddress
was not discovered) when connecting to a Spotify Connect capable device. Methods updated were:PlayerActivateDevices
,GetSpotifyConnectDevices
,PlayerResolveDeviceId
.
- Updated
SpotifyClient
methods that callPlayerResolveDeviceId
with a new parameter that indicates if the device should be resolved (true) or not (False). This allows multiple methods that callPlayerResolveDeviceId
to be called from the same method, and only resolve the device one time. This was sone to ensure that device resolution did not occur more than once, as it's such a time consuming operation. Methods updated were:PlayerMediaPlayContext
,PlayerMediaPlayTrackFavorites
,PlayerMediaPlayTracks
,PlayerTransferPlayback
.
- Updated
SpotifyClient.PlayerResolveDeviceId
method callers to log a warning message if the specified device value could not be resolved and just return a null value.
- Updated
SpotifyClient.PlayerResolveDeviceId
method callers to gracefully handle theSpotifyApiError
error if the specified device value could not be resolved.
- Updated
SpotifyClient.PlayerResolveDeviceId
method to raise aSpotifyApiError
error if the specified device value could not be resolved.
- Updated
SpotifyConnectDevices
model to include aDateLastRefreshed
property that indicates when the device list was last refreshed.
- Updated
SpotifyClient.GetSpotifyConnectDevices
method to store results to the configuration cache.
- Updated
ZeroconfConnect.Connect
method to provide a small delay after processing the Spotify Zeroconf API command, which will give the device some time to process the change. - Updated
ZeroconfConnect.Disconnect
method to provide a small delay after processing the Spotify Zeroconf API command, which will give the device some time to process the change.
- Updated
SpotifyClient.GetSpotifyConnectDevices
method to retrieve dynamic Spotify Connect devices as well as static devices. Dynamic devices are Spotify Connect devices that are not found in Zeroconf discovery process, but still exist in the player device list. These are usually Spotify Connect web or mobile players with temporary device id's.
- Added
SpotifyClient.GetSpotifyConnectDevices
method that gets information about all available Spotify Connect player devices (not just ones controlled by a user).
- Added
SpotifyClient.ZeroconfClient
property that contains a reference to the Zeroconf client instance used to discover Spotify Connect devices. - Added
SpotifyDiscovery.ZeroconfClient
property that contains a reference to the Zeroconf client instance used to discover Spotify Connect devices.
- Added
SpotifyClient.PlayerActivateDevices
method that activates all Spotify Connect player devices, and (optionally) switches the active user context to the current user context. Note that you can still activate individual devices using theZeroconfConnect.Connect
method if you wish. - Added
SpotifyClient.PlayerResolveDeviceId
method that resolves a Spotify Connect device identifier from a specified device id, name, alias id, or alias name. This will ensure that the device id can be found on the network, as well as connect to the device (if necessary) with the current user context. - Updated various
SpotifyClient
methods to utilize the newSpotifyClient.PlayerResolveDeviceId
method so that device id's are automatically activated if they are currently deactivated but available on the local network. Methods updated were:PlayerMediaPlayContext
,PlayerMediaPlayTrackFavorites
,PlayerMediaPlayTracks
,PlayerTransferPlayback
. - Updated
SpotifyClient
class constructor so that Spotify Connect user context credentials (e.g. username and password) may be supplied for the resolution of device id / name. Note these credentials are only used for Spotify Connect device resolution, and are not used by method calls that are made to the underlying Spotify Web API. - Updated
SpotifyDiscovery
class constructor so that aZeroconf
instance can be provided. This allows Home Assistant integrations to use the HA Zeroconf instance and avoid the log warnings of multiple Zeroconf instances in use. - Removed
SpotifyClient
processing from theSpotifyDiscovery
class, as the processing was moved into theSpotifyClient
class itself.
- Forgot to re-build prior to deploying!
- Moved all Spotify Zeroconf API related classes to a new namespace called
zeroconfapi
. Classes moved were:ZeroconfResponse
,ZeroconfGetInfo
,ZeroconfGetInfoAlias
,ZeroconfGetInfoDrmMediaFormat
. - Added
ZeroconfConnect
class that contains various methods that support interfacing with the Spotify Zeroconf API. - Added
ZeroconfConnect.Connect
method that calls theaddUser
Spotify Zeroconf API endpoint to issue a call to SpConnectionLoginBlob. If successful, the associated device id is added to the Spotify Connect active device list for the specified user account. - Added
ZeroconfConnect.Disconnect
method that calls theresetUsers
Spotify Zeroconf API endpoint to issue a call to SpConnectionLogout; the currently logged in user (if any) will be logged out of Spotify Connect, and the device id removed from the active Spotify Connect device list. - Added
ZeroconfConnect.GetInformation
method that calls thegetInfo
Spotify Zeroconf API endpoint to return information about the device. - Removed
SpotifyClient.ZeroconfAddUser
method, and replaced it with methodZeroconfConnect.Connect
. - Removed
SpotifyClient.ZeroconfResetUsers
method, and replaced it with methodZeroconfConnect.Disconnect
. - Removed
SpotifyClient.ZeroconfGetInformation
method, and replaced it with methodZeroconfConnect.GetInformation
.
- Updated the following requirements due to Home Assistant dependency issues: 'oauthlib>=3.2.2', 'platformdirs>=4.1.0', 'requests>=2.31.0', 'requests_oauthlib>=1.3.1', 'zeroconf>=0.132.2'.
- Updated
zeroconf
requirements to "zeroconf>=0.132.2". This was causing installation issues with other components that utilize zeroconf.
- Added
SpotifyDiscovery.DiscoveredResults
class property that will contain an array ofZeroconfDiscoveryResult
items that contain discovery details for each service that was discovered. - Added model
ZeroconfDiscoveryResult
class that contains detailed Zeroconf ServiceInfo details that were discovered via Zeroconf. - Added model
ZeroconfProperty
class that contains Zeroconf ServiceInfo property details that were discovered via Zeroconf. - Added model
ZeroconfResponse
class that contains Zeroconf basic response variables. - Added model
ZeroconfGetInfo
class that contains Zeroconf action=getInfo response variables. - Added model
ZeroconfGetInfoAlias
class that contains Zeroconf action=getInfo Alias response variables. - Added model
ZeroconfGetInfoDrmMediaFormat
class that contains Zeroconf action=getInfo DRM Media format response variables. - Added logic to handle
503 Server Error
responses from the Spotify Web API. - Added support for Spotify DJ playlist retrieval. As the Spotify Web API does not support retrieving the DJ playlist (
spotify:playlist:37i9dQZF1EYkqdzj48dyYq
), it simply returns a manually built representation of the playlist. Note that playlist tracks cannot be retrieved either for the DJ playlist, as the Spotify Web API does not support it.
- Added device name support to the following player methods that take a
deviceId
argument for player functions. You can now specify either a device id or device name in thedeviceId
argument to target a specific Spotify Connect Player device.SpotifyClient
methods updated were:AddPlayerQueueItem
,PlayerMediaPause
,PlayerMediaPlayContext
,PlayerMediaPlayTrackFavorites
,PlayerMediaPlayTracks
,PlayerMediaResume
,PlayerMediaSeek
,PlayerMediaSkipNext
,PlayerMediaSkipPrevious
,PlayerSetRepeatMode
,PlayerSetShuffleMode
,PlayerSetVolume
,PlayerTransferPlayback
. - Added
SpotifyClient.PlayerConvertDeviceNameToId
method that converts a Spotify Connect player device name to it's equivalent id value if the value is a device name. If the value is a device id, then the value is returned as-is.
- Added
Device.IsMuted
property to indicate if volume is zero (muted) or not (unmuted). - Added
PlayerPlayState.IsMuted
property to indicate if player device volume is zero (muted) or not (unmuted). - Updated
SpotifyClient.PlayerMediaPlayTrackFavorites
method to set the shuffle mode prior to starting play of the track list. Prior to this change, the first track would always play first regardless of the shuffle setting; now it is part of the shuffle.
- Added
ArtistInfo
model that contains artist bio information. - Added
ArtistInfoTourEvent
model that contains artist on tour event information. - Added
SpotifyClient.GetArtistInfo
method to retrieve artist bio information for a specified Artist id. - Added
SpotifyClient.PlayerMediaPlayTrackFavorites
method to play all tracks contained in the current users track favorites. - Added
SpotifyClient.RemovePlaylist
method to remove a playlist by calling theUnfollowPlaylist
method.
- Updated
SpotifyClient.PlayerVerifyDeviceDefault
method to check for a nullDevice.Id
value when determining if an active device was set. - Added
delay
argument to variousSpotifyClient
player command-related methods, which allows the Spotify Web API a little bit of time to process the change before returning from the method. Methods updated:PlayerMediaPause
,PlayerMediaPlayContext
,PlayerMediaPlayTracks
,PlayerMediaResume
,PlayerMediaSeek
,PlayerMediaSkipNext
,PlayerMediaSkipPrevious
,PlayerSetRepeatMode
,PlayerSetShuffleMode
,PlayerSetVolume
,PlayerTransferPlayback
,PlayerVerifyDeviceDefault
. Default delay is 250 milliseconds, but you can adjust accordingly (including removing the delay if you wish).
- Updated
PlayerPlayState.__init__
model to properly parse the Actions property.
- Updated
Device.__init__
model to validate the following properties were initialized from Spotify Web API results, and to set defaults if not: IsActive = False, IsPrivateSession = False, IsRestricted = False, SupportsVolume = False, VolumePercent = 0. - Updated
PlayerPlayState.__init__
model to validate the following properties were initialized from Spotify Web API results, and to set defaults if not: Actions = PlayerActions(), Device = Device(), CurrentlyPlayingType = 'unknown', IsPlaying = False, ProgressMS = 0, RepeatState = 'off', ShuffleState = 'off', SmartShuffle = 'off', Timestamp = 0. - Updated
PlayerActions.__init__
model to validate the following properties were initialized from Spotify Web API results, and to set defaults if not: InterruptingPlayback = False, Pausing = False, Resuming = False, Seeking = False, SkippingNext = False, SkippingPrev = False, TogglingRepeatContext = False, TogglingRepeatTrack = False, TogglingShuffle = False, TransferringPlayback = False.
- Updated
SpotifyClient.FollowArtists
method to make theids
argument optional; if not supplied, the currently playing track artist id value is used instead. - Updated
SpotifyClient.UnfollowArtists
method to make theids
argument optional; if not supplied, the currently playing track artist id value is used instead. - Updated
SpotifyClient.SaveAlbumFavorites
method to make theids
argument optional; if not supplied, the currently playing track album id value is used instead. - Updated
SpotifyClient.RemoveAlbumFavorites
method to make theids
argument optional; if not supplied, the currently playing track album id value is used instead. - Updated
SpotifyClient.CreatePlaylist
method to add theimagePath
argument, which assigns an image to the created playlist. - Updated
SpotifyClient.ChangePlaylistDetails
method to add theimagePath
argument, which assigns an image to the updated playlist details.
- Fixed
SpotifyClient.SaveTrackFavorites
method for a bug introduced with v1.0.35 update causeing 'object of type 'bool' has no len()' exceptions. - Fixed
SpotifyClient.RemoveTrackFavorites
method for a bug introduced with v1.0.35 update causeing 'object of type 'bool' has no len()' exceptions. - Fixed
SpotifyClient.AddPlaylistItems
method for a bug introduced with v1.0.35 update causeing 'object of type 'bool' has no len()' exceptions. - Fixed
SpotifyClient.RemovePlaylistItems
method for a bug introduced with v1.0.35 update causeing 'object of type 'bool' has no len()' exceptions.
- Updated
SpotifyClient.SaveTrackFavorites
method to make theids
argument optional; if not supplied, the currently playing id value is used instead. - Updated
SpotifyClient.RemoveTrackFavorites
method to make theids
argument optional; if not supplied, the currently playing id value is used instead. - Updated
SpotifyClient.AddPlaylistItems
method to make theuris
argument optional; if not supplied, the currently playing uri value is used instead. - Updated
SpotifyClient.RemovePlaylistItems
method to make theuris
argument optional; if not supplied, the currently playing uri value is used instead.
- Fixed
SpotifyClient.CreatePlaylist
method to properly pass the Public and Collaborative parameters to the Spotify Web API. Prior to this, any created playlists were being marked with Public=True.
- Added
Device.SelectItemNameAndId
property to return a string that can be used in a selection list in the form of "Name (Id)". - Added
Device.GetIdFromSelectItem
method to return the Id portion of aSelectItemNameAndId
property value. - Added
Device.GetNameFromSelectItem
method to return the Name portion of aSelectItemNameAndId
property value.
- Updated
PlayerQueueInfo
to correctly return theSummary
property value when the queue is empty. - Removed
SpotifyClient.SearchPlaylists
method argumentspotifyOwnedOnly
, as it can be replaced by other functionality (e.g.GetCategoryPlaylists
).
- Updated all models that used a
root.get('...',[])
syntax to useroot.get('...',None)
instead, as Spotify Web API will sometimes return anull
instead of an[]
(empty array) for a key item value. This was causing methods to fail with'NoneType' object is not iterable
errors.
- Updated
SpotifyClient.SearchPlaylists
method with argumentspotifyOwnedOnly
to filter found items by owner. This simulates the spotify "content generated for you" functionality provided by the Spotify AI engine.
- Added
ContainsId
method to the following classes:AlbumPageSimplified
,AudiobookPageSimplified
,ChapterPageSimplified
,EpisodePageSimplified
,PlaylistPageSimplified
,ShowPageSimplified
, andTrackPageSimplified
. - Updated
SpotifyClient.GetPlayerRecentTracks
method with auto-pagination support to retrieve ALL available items (or up to a limit total).
- Added
SpotifyClient.SearchAlbums
method to search Spotify for matching Album criteria. - Added
SpotifyClient.SearchArtists
method to search Spotify for matching Artist criteria. - Added
SpotifyClient.SearchAudiobooks
method to search Spotify for matching Audiobook criteria. - Added
SpotifyClient.SearchEpisodes
method to search Spotify for matching Episode criteria. - Added
SpotifyClient.SearchPlaylists
method to search Spotify for matching Playlist criteria. - Added
SpotifyClient.SearchShows
method to search Spotify for matching Show criteria. - Added
SpotifyClient.SearchTracks
method to search Spotify for matching Track criteria. - Updated
SpotifyClient
methods to add auto-pagination to retrieve ALL available items (or up to a limit total). Methods modified were:GetAlbumFavorites
,GetAlbumNewReleases
,GetArtistAlbums
,GetArtistsFollowed
,GetCategoryPlaylists
,GetFeaturedPlaylists
,GetPlaylistFavorites
,GetPlaylistsForUser
,GetPlaylistItems
,GetAlbumTracks
,GetAudiobookChapters
,GetAudiobookFavorites
,GetBrowseCategorys
,GetEpisodeFavorites
,GetShowEpisodes
,GetShowFavorites
,GetTrackFavorites
,GetUsersTopArtists
,GetUsersTopTracks
. - Renamed
SpotifyClient.GetBrowseCategorys
method toGetBrowseCategorysList
. - Renamed
SpotifyClient.GetBrowseCategorysByPage
method toGetBrowseCategorys
. - Added
Category.Uri
property to simulate a Spotify-like Uri value for a category. This is a helper property - no value with this name is returned from the Spotify Web API. - Updated
PageObject
model with property setters for theCursorBefore
,CursorAfter
,Limit
,Offset
andTotal
properties. This allows a user to modify the values when performing custom paging operations. - Updated all
SpotifyClient
methods that utilize amarket
argument to ensure that a market value was either supplied or implied (using an authorization access token with a user profile). The Spotify Web API was returning null results for some methods that did not supply a market value while using a public access token (e.g. no country code default).
- Updated
SpotifyClient.GetPlayerRecentTracks
method to retrieve the last 24 hours of play history if neitherafter
orbefore
arguments were specified.
- Added
SpotifyClient.ToString
method to display a string representation of the class. - Added
SpotifyClient.ConfigurationCache
property to store static configuration objects. - Added
SpotifyClient.ClearConfigurationCache
method to clear the configuration cache. - Updated
SpotifyClient
methods to add returned results to theConfigurationCache
for faster access:GetBrowseCategory
,GetBrowseCategorys
,GetGenres
,GetMarkets
,GetPlayerDevice
,GetPlayerDevices
,GetUsersCurrentProfile
. This increases performance when accessing Spotify information that rarely changes.
- Updated urllib3 requirements to "urllib3>=1.21.1,<1.27", to ensure urllib3 version 2.0 is not used. Home Assistant requires urllib3 version less than 2. This was causing intermittent issues with calling requests resulting in **kwargs errors when used in Home Assistant!
- Updated
SpotifyClient.MakeRequest
method to pass ALL parameters in the various request methods. Prior to this fix, there were urllib3 request issues with **KWARGS while using the api in a Home Assistant integration.
- Updated
SpotifyClient.MakeRequest
method to use json library to create JSON request body, instead of the urllib3request(...,json=...)
method. The urllib3request
class seems to have issues processing json data.
- Added
SpotifyClient.GetIdFromUri
method to return the Id portion of a Uri value. - Added
SpotifyClient.GetTypeFromUri
method to return the Type portion of a Uri value. - Updated
SpotifyClient.GetPlayerDevice
method to return a selected device by id or name. - Added
SpotifyDiscovery
class that discovers Spotify Connect devices via Zeroconf. - Updated
UserProfileSimplified
method to default theDisplayName
property to theId
property value if a display name was not set.
- Added
SearchResponse.GetSpotifyOwnedPlaylists
method that gets a list of all playlist items in the underlying search response that have an owner ofspotify:user:spotify
. These are playlists that are generated for you by the spotify ai engine. - Added
additionalTypes
argument toSpotifyClient.GetPlayerPlaybackState
method. - Added
additionalTypes
argument toSpotifyClient.GetPlayerNowPlaying
method. - Updated
SpotifyClient.GetPlayerDevices
method to return the list of devices in sorted order by Name.
- Added
PlayHistoryPage.GetTracks
method that gets a list of all tracks contained in the underlyingPlayHistory
list. This is a convenience method so one does not have to loop through thePlayHistory
array ofTrack
objects to get the list of tracks.
- Updated
TrackPageSaved
model to parse aTrack
object instead of aTrackSimplified
object. TheTrack
object contains the extraAlbum
,ExternalIds
andPopularity
properties. - Updated
TrackRecommendations
model to parse aTrack
object instead of aTrackSimplified
object. TheTrack
object contains the extraAlbum
,ExternalIds
andPopularity
properties. - Added
AlbumPageSaved.GetAlbums
method that gets a list of all albums contained in the underlyingItems
list. This is a convenience method so one does not have to loop through theItems
array ofAlbumSaved
objects to get the list of albums. - Added
TrackPageSaved.GetTracks
method that gets a list of all tracks contained in the underlyingItems
list. This is a convenience method so one does not have to loop through theItems
array ofTrackSaved
objects to get the list of tracks. - Added
EpisodePageSaved.GetEpisodes
method that gets a list of all episodes contained in the underlyingItems
list. This is a convenience method so one does not have to loop through theItems
array ofEpisodeSaved
objects to get the list of episodes. - Added
ShowPageSaved.GetShows
method that gets a list of all shows contained in the underlyingItems
list. This is a convenience method so one does not have to loop through theItems
array ofShowSaved
objects to get the list of shows. - Added an
ImageUrl
property to all models that have anImages
collection. The new property returns the first image url in theImages
list, if images are defined; otherwise, null. This is a convenience method so one does not have to loop through theImages
array ofImageObject
objects to get an image url.
- Updated
SpotifyClient
methods to set the request header authorization key directly, rather than assigning a new dictionary to the value. - Updated
SpotifyClient.MakeRequest
method to apply token refresh changes to the request authorization header if present. Prior to this fix, the request was still referencing the expired token value. - Added
SpotifyAuthToken.HeaderKey
property for request header access. - Added
SpotifyAuthToken.HeaderValue
property for request header access. - Removed
SpotifyAuthToken.GetHeaders
method, as it was no longer required.
- Updated
SpotifyClient
to correctly support thetokenUpdater
callable to update a token for an external provider. - Updated
AuthClient
to correctly support thetokenUpdater
callable to update a token for an external provider.
- Updated numerous classes with a
ToDictionary
method to allow dictionary representation of data.
- Updated
SpotifyClient
methods with better logging information. - Updated
AuthClient
methods with better logging information.
- Updated
SpotifyClient
methods to add basic validation for required parameter values.
- Updated
SpotifyClient._CheckResponseForErrors
method to use json library to parse JSON response, instead of the urllib3HTTPResponse.json()
method. The urllib3HTTPResponse
class can return missing attributes and methods when processing redirects.
- Updated
SpotifyClient._CheckResponseForErrors
method with better logging information.
- Updated
SpotifyClient._CheckResponseForErrors
method with better logging information.
- Added
SpotifyClient.SetAuthTokenFromToken
method to allow the authorization token to be used from an existing OAuth2 token. - Removed
SpotifyClient.SetAuthTokenFromSession
method in favor of theSetAuthTokenFromToken
method. - Updated scope processing to pass a space-delimited string of scopes instead of an array of strings. It appears that the Spotify Web API will accept both, but API documentation states that a space-delimited string is preferred.
- Updated
SpotifyClient.SetAuthTokenFromSession
method to correct a bug related to Home Assistant OAuth2Session object.
- Added
SpotifyClient.SetAuthTokenFromSession
method to allow the authorization token to be used from an existing OAuth2Session.
- Allow customization of the redirect uri host and port values in the token authorization process.
- Changed urllib3 requirements to a non-specific version so it could run with Home Assistant addons.
- Changed Development Status to 5 - Production / Stable.
- Removed invalid requirement from setup.py.
- Added
SpotifyAuthToken.ProfileId
property that indicates the token profile that was loaded.
- Corrected the
SpotifyClient.GetTrackRecommendations
method to process themarket
,maxSpeechiness
, andtargetSpeechiness
arguments correctly. - Updated
SpotifyClient.SetAuthTokenAuthorizationCode
method to use a 120 second timeout value while waiting for an authorize response from the user. - Updated
SpotifyClient.SetAuthTokenAuthorizationCodePkce
method to use a 120 second timeout value while waiting for an authorize response from the user.
- Version 1 initial release.