Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The addon listens to the following topics (prefixed with the configured topic pr
- "toggle" to toggle between play and pause
- "next" to play the next track
- "previous" to play the previous track
* command/progress: A string having format hours:minutes:seconds. Changes position of currently played file


See also
Expand Down
7 changes: 7 additions & 0 deletions service.mqtt/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,20 @@ def processplaybackstate(data):
elif data=="previous":
player.playprevious()

def processprogress(data):
hours, minutes, seconds = [int(i) for i in data.split(":")]
time = hours * 3600 + minutes * 60 + seconds
player.seekTime(time)

def processcommand(topic,data):
if topic=="notify":
processnotify(data)
elif topic=="play":
processplay(data)
elif topic=="playbackstate":
processplaybackstate(data)
elif topic=="progress":
processprogress(data)
else:
mqttlogging("MQTT: Unknown command "+topic)

Expand Down