Closed wildestpixel closed 4 years ago
Indeed it's possible. As you might have guessed, any function that is added to frontend.py
can be bound to a button press by editing mopidy.conf
, so there's no reason why your snippet can't be added to this library.
Do you want to raise this addition as a pull request? I'd be happy to review/merge it.
Reopen this - needed to add to /usr/local/lib/python3.7/dist-packages/mopidy_raspberry_gpio/pinconfig.py
the allowed defined function
valid_events = ValidList(
["play_pause", "play_stop", "prev", "next", "volume_up", "volume_down"]
And now successfully working on my rotated to 270 display (so power cable leads out to the rear) with the following GPIO assignment
[raspberry-gpio]
enabled = true
bcm5 = volume_up,active_low,250
bcm6 = next,active_low,250
bcm16 = volume_down,active_low,250
bcm20 = play_stop,active_low,250
bcm24 = play_stop,active_low,250
(For users of both board revisions)
Submitted pull request, failing on flake8 and black - possibly based on dirty edit of quotation marks.
Second time's a charm, eh! Thanks for testing and feeding back with the fix- suffice to say... things are hectic still, and I'm not firing on all cylinders.
Checking whether this is possible as behaviour on the button via mopidy core is similar to
mpc toggle
and keeps the alsa device locked, meaning if you wanted to for example stream Raspotify or Shairport-sync you need firstly to unlock the device with equivalentmpc stop
ormpc clear
.I'm presently achieving this by running a script in GoCoEdit via Applewatch, but would work better with an option like
This possible simply editing
/usr/local/lib/python3.7/dist-packages/mopidy_raspberry_gpio/frontend.py
and the gpio options inmopidy.conf
?