-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ 1.0.31 ] * Updated underlying
spotifywebapiPython
package require…
…ment to version 1.0.64. * The underlying `spotifywebapiPython` update changes the way Spotify Connect Zeroconf API return codes are processed. It now processes 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 Connect `status`, `statusString` and `spotifyError` JSON properties seem to be consistent across the board. * The underlying `spotifywebapiPython` update also filters 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. This was causing two entries to appear in the device list, when there should have been only one.
- Loading branch information
Showing
7 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
from copy import deepcopy | ||
|
||
# # get smartinspect logger reference; create a new session for this module name. | ||
# from smartinspectpython.siauto import SIAuto, SILevel, SISession, SIColors | ||
# import logging | ||
# _logsi:SISession = SIAuto.Si.GetSession(__name__) | ||
# if (_logsi == None): | ||
# _logsi = SIAuto.Si.AddSession(__name__, True) | ||
# _logsi.SystemLogger = logging.getLogger(__name__) | ||
|
||
def passwordMaskDictionary(inputObj:dict) -> dict: | ||
""" | ||
Checks keys in a dictionary any keys that contain `password` and masks the | ||
value so that the password is not displayed in a trace file. | ||
Args: | ||
inputObj (dict): | ||
Dictionary object to check. | ||
Returns: | ||
A copy of the `inputObj` source dictionary with passwor(s) masked. | ||
Note that this method performs a simple copy of the dictionary. | ||
""" | ||
# if input is null then don't bother. | ||
if (inputObj is None): | ||
return inputObj | ||
|
||
# create a new dictionary. | ||
result:dict = {} | ||
|
||
# process keys in the dictionary. | ||
key:str | ||
for key in inputObj.keys(): | ||
keyLower:str = key.lower() | ||
if (keyLower.find('password') == -1): | ||
result[key] = inputObj[key] | ||
else: | ||
value:str = inputObj[key] | ||
if (value is not None) and (isinstance(value, str)): | ||
result[key] = ''.ljust(len(value), '*') | ||
|
||
return result | ||
|
||
|
||
def passwordMaskString(inputObj:str) -> str: | ||
""" | ||
Checks a string for a password value and masks the value so that the password is not displayed | ||
in a trace file. | ||
Args: | ||
inputObj (str): | ||
String object to check. | ||
Returns: | ||
A copy of the `inputObj` value with password masked. | ||
""" | ||
# if input is null then don't bother. | ||
if (inputObj is None): | ||
return inputObj | ||
|
||
# create a new value. | ||
result:str = ''.ljust(len(inputObj), '*') | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters