From b8998a164ff713a4ce7dc968ad03e600708514c5 Mon Sep 17 00:00:00 2001 From: void-spark <81029971+void-spark@users.noreply.github.com> Date: Mon, 24 Jan 2022 23:02:33 +0100 Subject: [PATCH] Fix some bugs from API changes --- plugin.service.mqtt/addon.xml | 2 +- plugin.service.mqtt/changelog.txt | 4 ++++ plugin.service.mqtt/service.py | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin.service.mqtt/addon.xml b/plugin.service.mqtt/addon.xml index f08123a..8be1641 100644 --- a/plugin.service.mqtt/addon.xml +++ b/plugin.service.mqtt/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/plugin.service.mqtt/changelog.txt b/plugin.service.mqtt/changelog.txt index 6b42c59..757d02e 100644 --- a/plugin.service.mqtt/changelog.txt +++ b/plugin.service.mqtt/changelog.txt @@ -1,3 +1,7 @@ +v0.22 - 2022-01-24 + - Fixed some things to follow conventions + - Tested on 19.4 Matrix + v0.21 - 2021-03-22 - Convert to work with Kodi 19 Matrix (just some minor changes were needed) - Update MQTT client Paho to latest: 1.5.1 diff --git a/plugin.service.mqtt/service.py b/plugin.service.mqtt/service.py index eda46f2..cf3571a 100644 --- a/plugin.service.mqtt/service.py +++ b/plugin.service.mqtt/service.py @@ -39,8 +39,7 @@ def ignorelist(data,val): def mqttlogging(log): if __addon__.getSetting("mqttdebug")=='true': - #xbmc.log(log) - xbmc.log(log,level=xbmc.LOGNOTICE) + xbmc.log(log,level=xbmc.LOGINFO) def sendrpc(method,params): res=xbmc.executeJSONRPC(json.dumps({"jsonrpc":"2.0","method":method,"params":params,"id":1})) @@ -260,6 +259,7 @@ def processcecstate(data): os.system('kodi-send --action=""') def processcommand(topic,data): + mqttlogging("MQTT: Received command %s with data %s" % (topic, data)) if topic=="notify": processnotify(data) elif topic=="play": @@ -287,7 +287,7 @@ def msghandler(mqc,userdata,msg): return mytopic=msg.topic[len(topic):] if mytopic.startswith("command/"): - processcommand(mytopic[8:],msg.payload) + processcommand(mytopic[8:],msg.payload.decode("utf-8")) except Exception as e: mqttlogging("MQTT: Error processing message %s: %s" % (type(e).__name__,e))