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:

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

on_stop()[source]#

Callback invoked when the process stops

run()[source]#

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