Skip to content
Snippets Groups Projects
Commit 24514e14 authored by 42loop's avatar 42loop
Browse files

added simple get status command

parent 54920066
Branches
No related tags found
No related merge requests found
......@@ -103,6 +103,17 @@ def publishprogress():
state={"kodi_time":convtime(pt),"kodi_totaltime":convtime(tt)}
publish("progress","%.1f" % progress,state)
#
# Publishes minimal playback status
#
def publishstatus():
global player
if not player.isPlaying():
publish("playstate","0")
else:
publish("playstate","1")
#
# Publish more details about the currently playing item
#
......@@ -218,6 +229,9 @@ def processhidegui(data):
os.system(cmd)
xbmc.executebuiltin('ReloadSkin()')
def processgetstatus(data):
publishstatus()
def processcommand(topic,data):
if topic=="notify":
......@@ -228,6 +242,8 @@ def processcommand(topic,data):
processplaybackstate(data)
elif topic=="hidegui":
processhidegui(data)
elif topic=="status":
processgetstatus()
else:
mqttlogging("MQTT: Unknown command "+topic)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment