spotifywebapiPython 1.0.138__py3-none-any.whl → 1.0.140__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of spotifywebapiPython might be problematic. Click here for more details.

Files changed (23) hide show
  1. {spotifywebapiPython-1.0.138.dist-info → spotifywebapiPython-1.0.140.dist-info}/METADATA +1 -1
  2. {spotifywebapiPython-1.0.138.dist-info → spotifywebapiPython-1.0.140.dist-info}/RECORD +23 -23
  3. spotifywebapipython/const.py +1 -1
  4. spotifywebapipython/docs/__init__.html +14 -2
  5. spotifywebapipython/docs/index.html +2 -2
  6. spotifywebapipython/docs/search.js +1 -1
  7. spotifywebapipython/docs/spotifywebapipython/const.html +3 -3
  8. spotifywebapipython/docs/spotifywebapipython/saappmessages.html +2 -2
  9. spotifywebapipython/docs/spotifywebapipython/sautils.html +4 -2
  10. spotifywebapipython/docs/spotifywebapipython/spotifyapierror.html +2 -2
  11. spotifywebapipython/docs/spotifywebapipython/spotifyapimessage.html +2 -2
  12. spotifywebapipython/docs/spotifywebapipython/spotifyauthtoken.html +2 -2
  13. spotifywebapipython/docs/spotifywebapipython/spotifyclient.html +2 -2
  14. spotifywebapipython/docs/spotifywebapipython/spotifydiscovery.html +7 -7
  15. spotifywebapipython/docs/spotifywebapipython/spotifywebapiauthenticationerror.html +2 -2
  16. spotifywebapipython/docs/spotifywebapipython/spotifywebapierror.html +2 -2
  17. spotifywebapipython/models/spotifyconnectdevices.py +23 -0
  18. spotifywebapipython/sautils.py +6 -1
  19. spotifywebapipython/spotifyclient.py +33 -26
  20. spotifywebapipython/spotifydiscovery.py +10 -11
  21. {spotifywebapiPython-1.0.138.dist-info → spotifywebapiPython-1.0.140.dist-info}/LICENSE +0 -0
  22. {spotifywebapiPython-1.0.138.dist-info → spotifywebapiPython-1.0.140.dist-info}/WHEEL +0 -0
  23. {spotifywebapiPython-1.0.138.dist-info → spotifywebapiPython-1.0.140.dist-info}/top_level.txt +0 -0
@@ -126,10 +126,10 @@ class SpotifyDiscovery:
126
126
  return self._DiscoveryResults
127
127
 
128
128
 
129
- def GetIndexById(self, value:str) -> int:
129
+ def GetIndexByKey(self, value:str) -> int:
130
130
  """
131
131
  Returns the index of the `DiscoveryResults` collection that contains
132
- the specified device id value; otherwise, -1.
132
+ the specified device key value; otherwise, -1.
133
133
  """
134
134
  result:int = -1
135
135
  if value is None:
@@ -140,7 +140,7 @@ class SpotifyDiscovery:
140
140
 
141
141
  # process all discovered devices.
142
142
  for i in range(len(self._DiscoveryResults)):
143
- if (self._DiscoveryResults[i].Id.lower() == value):
143
+ if (self._DiscoveryResults[i].Key.lower() == value):
144
144
  result = i
145
145
  break
146
146
  return result
@@ -328,20 +328,19 @@ class SpotifyDiscovery:
328
328
  # add device name to list of registered names.
329
329
  self._DiscoveredDeviceNames[result.Id] = result.DeviceName
330
330
 
331
- # add / update discovered results by a unique result ID value, which is comprised
332
- # of the name, ip address, and ip port of the service. we use the unique ID value
333
- # since some manufacturers use random ip port numbers, which will ensure that we
334
- # remove (or update) the unique service entry. in other words, we can't just rely
335
- # on the name since a manufacturer could re-register the same name using a different
336
- # ip port value.
337
- idx:int = self.GetIndexById(result.Id)
331
+ # add / update discovered results by serviceinfo key value.
332
+ # we use the serviceinfo KEY value (not SERVERKEY) since some manufacturers use random ip port
333
+ # numbers, and the port number could have been updated. in this case, the key SHOULD remain the same.
334
+ # note that a different serviceinfo key SHOULD be created for speaker groups; at least they are for BOSE devices.
335
+ idx:int = self.GetIndexByKey(result.Key)
338
336
  if (idx == -1):
339
337
  self._DiscoveryResults.append(result) # add new result
338
+ _logsi.LogVerbose("Spotify Connect Zeroconf service discovery result was added: %s (%s)" % (result.Id, serviceStateChangeDesc))
340
339
  else:
341
340
  self._DiscoveryResults[idx] = result # update existing result
341
+ _logsi.LogVerbose("Spotify Connect Zeroconf service discovery result was updated: %s (%s)" % (result.Id, serviceStateChangeDesc))
342
342
 
343
343
  # trace.
344
- _logsi.LogVerbose("Spotify Connect Zeroconf service %s: %s" % (serviceStateChangeDesc, result.Id))
345
344
  if (self._PrintToConsole == True):
346
345
  print("Spotify Connect Zeroconf service %s: %s" % (serviceStateChangeDesc, result.Id))
347
346