You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use the LMSPlayer class directly with a MAC address that is not connected on the Logitech Media Server the following error occurs:
LMSTools/LMSTools/player.py", line 121, in parse_request
return self.request(command).get(key)
AttributeError: 'NoneType' object has no attribute 'get'
I have been able to resolve this by checking if the self.request(command) is None before attempting the attribute get(key):
I'm not sure if doing it in __init__ is correct as the player could disconnect after the object has been initialised.
I think there just needs to be some error handling either returning None (as you suggest) or by raising some exception (e.g. ClientNotConnected) and having the user's code decide how to handle it.
When attempting to use the LMSPlayer class directly with a MAC address that is not connected on the Logitech Media Server the following error occurs:
LMSTools/LMSTools/player.py", line 121, in parse_request
return self.request(command).get(key)
AttributeError: 'NoneType' object has no attribute 'get'
I have been able to resolve this by checking if the self.request(command) is None before attempting the attribute get(key):
However think this could be better resolved by checking if the player is present on the server during init
The text was updated successfully, but these errors were encountered: