]> kaliko git repositories - python-musicpdaio.git/blobdiff - mpdaio/connection.py
Add password (issue #4) and refactoring
[python-musicpdaio.git] / mpdaio / connection.py
index 072fc3fc1d0edbe22a9681f994446409f6fcb9da..d00f85af9755f81b84299dfe999ac624bb8f0e4c 100644 (file)
@@ -12,7 +12,7 @@ from collections import OrderedDict
 from types import TracebackType
 from typing import Any, List, Optional, Tuple, Type
 
-from . import HELLO_PREFIX
+from .const import HELLO_PREFIX
 from .exceptions import MPDProtocolError
 
 try:  # Python 3.7
@@ -140,7 +140,9 @@ class Connection(base):
         self._reader = reader
         self._writer = writer
         self._closed = False
+        self.auth = False
         self.in_use = False
+        self.version: str | None = None
 
     def __repr__(self):
         host = f"{self._host[0]}:{self._host[1]}"
@@ -176,7 +178,6 @@ class Connection(base):
             raise MPDProtocolError(f'Got invalid MPD hello: "{rcv}"')
         log.debug('consumed hello prefix: %r', rcv)
         self.version = rcv.split('\n')[0][len(HELLO_PREFIX):]
-        log.info('protocol version: %s', self.version)
 
     def __getattr__(self, name: str) -> Any:
         """All unknown attributes are delegated to the reader and writer"""