Created
August 11, 2016 00:01
-
-
Save G10DRAS/2eb9ec63821850b19af8a241735ff599 to your computer and use it in GitHub Desktop.
Python Script to Volume control MPD
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
import mpd | |
client = mpd.MPDClient() | |
client.timeout = None | |
client.idletimeout = None | |
client.connect('localhost', 6600) | |
client.listplaylists() | |
client.load("RADIO") | |
client.playlist() | |
client.status()['volume'] | |
client.status()['state'] | |
level = int(client.status()['volume']) + 10 | |
level = max(min(level, 100), 0) | |
client.setvol(level) | |
client.status()['volume'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment