]> kaliko git repositories - python-musicpd.git/commitdiff
Refactor mpd_version attribute
authorKaliko Jack <kaliko@azylum.org>
Sat, 1 Apr 2023 15:22:04 +0000 (17:22 +0200)
committerKaliko Jack <kaliko@azylum.org>
Sat, 1 Apr 2023 15:22:04 +0000 (17:22 +0200)
musicpd.py

index be9b8337fa6b55a87426ff69a613d3691c9da63a..f763a8e9e73ca4865bca8fce37cbe83d6d0f152e 100644 (file)
@@ -155,6 +155,8 @@ class MPDClient:
         #: Current connection timeout value, defaults to
         #: :py:obj:`CONNECTION_TIMEOUT` or env. var. ``MPD_TIMEOUT`` if provided
         self.mpd_timeout: Union[None,int] = None
+        #: Protocol version as exposed by the server
+        self.mpd_version: str = ''
         self._reset()
         self._commands = {
             # Status Commands
@@ -589,7 +591,7 @@ class MPDClient:
         self.mpd_version = line[len(HELLO_PREFIX):].strip()
 
     def _reset(self):
-        self.mpd_version = None
+        self.mpd_version = ''
         self._iterating = False
         self._pending = []
         self._command_list = None