music.mopidy
#
- class platypush.backend.music.mopidy.MusicMopidyBackend(host='localhost', port=6680, **kwargs)[source]#
Bases:
Backend
This backend listens for events on a Mopidy music server streaming port. Since this backend leverages the Mopidy websocket interface it is only compatible with Mopidy and not with other MPD servers. Please use the
platypush.backend.music.mpd.MusicMpdBackend
for a similar polling solution if you’re not running Mopidy or your instance has the websocket interface or web port disabled.Triggers:
platypush.message.event.music.MusicPlayEvent
if the playback state changed to playplatypush.message.event.music.MusicPauseEvent
if the playback state changed to pauseplatypush.message.event.music.MusicStopEvent
if the playback state changed to stopplatypush.message.event.music.NewPlayingTrackEvent
if a new track is being playedplatypush.message.event.music.PlaylistChangeEvent
if the main playlist has changedplatypush.message.event.music.VolumeChangeEvent
if the main volume has changedplatypush.message.event.music.MuteChangeEvent
if the mute status has changedplatypush.message.event.music.SeekChangeEvent
if a track seek event occurs
Requires:
Mopidy installed and the HTTP service enabled
- __init__(host='localhost', port=6680, **kwargs)[source]#
- Parameters:
bus – Reference to the bus object to be used in the backend
poll_seconds – If the backend implements a
loop
method, this parameter expresses how often the loop should run in seconds.kwargs – Key-value configuration for the backend