Closed novski closed 3 years ago
It should be included in the MPD status response: https://www.musicpd.org/doc/html/protocol.html#querying-mpd-s-status
Apparently that's now deprecated, though. It looks like it should maybe be using getvol
instead now.
Do you think i can just replace the key in Line 327 to : return int(status['getvol'])
?
I think that does not work:
root@OpenWrt:~/mpd-webthing/python# vi mpd-webthing.py
root@OpenWrt:~/mpd-webthing/python# python3 mpd-webthing.py
Traceback (most recent call last):
File "mpd-webthing.py", line 586, in <module>
run_server()
File "mpd-webthing.py", line 575, in run_server
thing = MPDThing()
File "mpd-webthing.py", line 135, in __init__
Value(self.get_volume(status), self.set_volume),
File "mpd-webthing.py", line 327, in get_volume
return int(status['getvol'])
KeyError: 'getvol'
edit: I checked the version and let that here as background information:
root@OpenWrt:~/mpd-webthing/python# mpd --version
Music Player Daemon 0.21.25 (0.21.25)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Database plugins:
simple proxy upnp
Storage plugins:
local curl
Decoders plugins:
[vorbis] ogg oga
[oggflac] ogg oga
[flac] flac
[faad] aac
[ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
[pcm]
Filters:
Tag plugins:
id3tag
Output plugins:
shout null fifo pipe alsa pulse httpd recorder
Encoder plugins:
null wave flac
Input plugins:
file alsa curl ffmpeg mms
Playlist plugins:
extm3u m3u pls xspf asx rss soundcloud flac cue embcue
Protocols:
file:// alsa:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// mms:// mmsh:// mmst:// mmsu://
Other features:
epoll iconv inotify ipv6 tcp un
root@OpenWrt:~/mpd-webthing/python#
No, it’s a separate call via the MPD API. I’ll probably work on a fix on Friday.
Hi I tried your webthing an run in to a error. Is that related to my config somehow? I don't understand where
status['volume']
comes from. Regards, novski