Paket und Klasse ?MPDCoverGrid? erstellt
This commit is contained in:
commit
2340f30dd9
2 changed files with 32 additions and 0 deletions
27
MPDCoverGrid.py
Normal file
27
MPDCoverGrid.py
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
from mpd import MPDClient
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class MPDCoverGrid:
|
||||||
|
def __init__(self, host='localhost', port='6600', password=None):
|
||||||
|
self._host = host
|
||||||
|
self._port = port
|
||||||
|
self._password = password
|
||||||
|
self.client = MPDClient()
|
||||||
|
|
||||||
|
|
||||||
|
def connect(self):
|
||||||
|
self.client.connect(self._host, self._port)
|
||||||
|
if self._password:
|
||||||
|
self.client.password(self._password)
|
||||||
|
|
||||||
|
|
||||||
|
def disconnect(self):
|
||||||
|
self.client.disconnect()
|
||||||
|
|
5
__init__.py
Normal file
5
__init__.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue