Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kodi2mqtt_import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
42loop
kodi2mqtt_import
Commits
1e325761
Commit
1e325761
authored
9 years ago
by
Oliver Wagner
Browse files
Options
Downloads
Patches
Plain Diff
v0.6 - 2015-07-29 - owagner
- include "kodi_playerid" and "kodi_playertype" in playbackstate updates [#2]
parent
dee5bca1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
service.mqtt/addon.xml
+1
-1
1 addition, 1 deletion
service.mqtt/addon.xml
service.mqtt/changelog.txt
+3
-0
3 additions, 0 deletions
service.mqtt/changelog.txt
service.mqtt/service.py
+5
-3
5 additions, 3 deletions
service.mqtt/service.py
with
11 additions
and
4 deletions
README.md
+
2
−
0
View file @
1e325761
...
...
@@ -44,6 +44,8 @@ The addon publishes on the following topics (prefixed with the configured topic
-
"kodi_playbackdetails": an object with further details about the playback state. This is effectivly the result
of the JSON-RPC call Player.GetItem with the properties "speed", "currentsubtitle", "currentaudiostream", "repeat"
and "subtitleenabled"
-
"kodi_playerid": the ID of the active player
-
"kodi_playertype": the type of the active player (e.g. "video")
*
status/progress: a JSON-encoded object with the fields
-
"val" is the percentage of progress in playing back the current item
-
"kodi_time": the playback position in the current item
...
...
This diff is collapsed.
Click to expand it.
service.mqtt/addon.xml
+
1
−
1
View file @
1e325761
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon
id=
"service.mqtt"
name=
"MQTT Adapter"
version=
"0.
5
"
provider-name=
"owagner"
>
<addon
id=
"service.mqtt"
name=
"MQTT Adapter"
version=
"0.
6
"
provider-name=
"owagner"
>
<requires>
<import
addon=
"xbmc.python"
version=
"2.19.0"
/>
</requires>
...
...
This diff is collapsed.
Click to expand it.
service.mqtt/changelog.txt
+
3
−
0
View file @
1e325761
v0.6 - 2015-07-29 - owagner
- include "kodi_playerid" and "kodi_playertype" in playbackstate updates [#2]
V0.5 - 2015-07-25 - owagner
- fixed script error occuring when playback details where not immediate
available when starting playback
...
...
This diff is collapsed.
Click to expand it.
service.mqtt/service.py
+
5
−
3
View file @
1e325761
...
...
@@ -11,6 +11,7 @@ __addon__ = xbmcaddon.Addon()
__version__
=
__addon__
.
getAddonInfo
(
'
version
'
)
activeplayerid
=-
1
activeplayertype
=
""
lasttitle
=
""
lastdetail
=
{}
...
...
@@ -40,15 +41,16 @@ def publish(suffix,val,more):
# the state is "playing"
#
def
setplaystate
(
state
,
detail
):
global
activeplayerid
global
activeplayerid
,
activeplayertype
if
state
==
1
:
res
=
sendrpc
(
"
Player.GetActivePlayers
"
,{})
activeplayerid
=
res
[
"
result
"
][
0
][
"
playerid
"
]
activeplayertype
=
res
[
"
result
"
][
0
][
"
type
"
]
res
=
sendrpc
(
"
Player.GetProperties
"
,{
"
playerid
"
:
activeplayerid
,
"
properties
"
:[
"
speed
"
,
"
currentsubtitle
"
,
"
currentaudiostream
"
,
"
repeat
"
,
"
subtitleenabled
"
]})
publish
(
"
playbackstate
"
,
state
,{
"
kodi_state
"
:
detail
,
"
kodi_playbackdetails
"
:
res
[
"
result
"
]})
publish
(
"
playbackstate
"
,
state
,{
"
kodi_state
"
:
detail
,
"
kodi_playbackdetails
"
:
res
[
"
result
"
]
,
"
kodi_playerid
"
:
activeplayerid
,
"
kodi_playertype
"
:
activeplayertype
})
publishdetails
()
else
:
publish
(
"
playbackstate
"
,
state
,{
"
kodi_state
"
:
detail
})
publish
(
"
playbackstate
"
,
state
,{
"
kodi_state
"
:
detail
,
"
kodi_playerid
"
:
activeplayerid
,
"
kodi_playertype
"
:
activeplayertype
})
def
convtime
(
ts
):
return
(
"
%02d:%02d:%02d
"
%
(
ts
/
3600
,(
ts
/
60
)
%
60
,
ts
%
60
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment