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
050bdfd9
Commit
050bdfd9
authored
6 years ago
by
42loop
Browse files
Options
Downloads
Patches
Plain Diff
fixed playbackstatus publisher
parent
d8c611b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
service.mqtt/service.py
+14
-2
14 additions, 2 deletions
service.mqtt/service.py
with
14 additions
and
2 deletions
service.mqtt/service.py
+
14
−
2
View file @
050bdfd9
...
...
@@ -62,6 +62,18 @@ def publish(suffix,val,more):
mqttlogging
(
"
MQTT: Publishing @
"
+
fulltopic
+
"
:
"
+
jsonstr
)
mqc
.
publish
(
fulltopic
,
jsonstr
,
qos
=
0
,
retain
=
True
)
def
publishstat
(
suffix
,
val
,
more
):
global
topic
,
mqc
robj
=
{}
robj
[
"
val
"
]
=
val
if
more
is
not
None
:
robj
.
update
(
more
)
jsonstr
=
json
.
dumps
(
robj
)
fulltopic
=
"
stat/
"
+
topic
+
suffix
mqttlogging
(
"
MQTT: Publishing @
"
+
fulltopic
+
"
:
"
+
jsonstr
)
mqc
.
publish
(
fulltopic
,
jsonstr
,
qos
=
0
,
retain
=
True
)
#
# Set and publishes the playback state. Publishes more info if
# the state is "playing"
...
...
@@ -109,9 +121,9 @@ def publishprogress():
def
publishstatus
():
global
player
if
not
player
.
isPlaying
():
publish
(
"
playstate
"
,
"
0
"
)
publish
stat
(
"
playstate
"
,
"
%i
"
%
0
,
None
)
else
:
publish
(
"
playstate
"
,
"
1
"
)
publish
stat
(
"
playstate
"
,
"
%i
"
%
1
,
None
)
#
...
...
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