platypush.backend.music.mopidy

class platypush.backend.music.mopidy.MusicMopidyBackend(host='localhost', port=6680, **kwargs)[source]

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:

Requires:
  • websocket-client (pip install websocket-client)
  • 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
run()[source]

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.