From 5f4fdcc57ddcab0f6709a255767a46e5bae82c02 Mon Sep 17 00:00:00 2001 From: Joerg Elfring Date: Thu, 2 Apr 2020 18:03:06 +0200 Subject: [PATCH] BREAKING: Use the same topics in STATE & CMD The CMD topic for power on/off was called 'power'. Now it is called 'devicePower' like in the STATE topic. This needs to be changed wherever mqtt commands are sent. --- README.md | 6 +++--- miotAirpurifierBridge.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c70f1ff..eaf0efe 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,9 @@ These topics are reported from the device: These topics can control the device: -| CMD Topic | Values expected | Meaning | -|-----------------------------|------------------|-------------------------------| -| `{mqtt_topic}/CMD/power` | on/off | Turn the device on or off | +| CMD Topic | Values expected | Meaning | +|--------------------------------------------|------------------------------|----------------------------------------------------------------------------| +| `{mqtt_topic}/CMD/devicePower` | on/off | Turn the device on or off | diff --git a/miotAirpurifierBridge.py b/miotAirpurifierBridge.py index 7681207..660f526 100644 --- a/miotAirpurifierBridge.py +++ b/miotAirpurifierBridge.py @@ -58,7 +58,7 @@ def on_mqttMessage(client, userdata, message): mqttMsgData = message.payload.decode("utf-8") mqttMsgTopic = message.topic log(2, "RECEIVED: " + mqttMsgTopic + ":" + mqttMsgData) - if ( mqttMsgTopic == mqtt_cmdTopic+"power" ): + if ( mqttMsgTopic == mqtt_cmdTopic+"devicePower" ): if (mqttMsgData == "on"): ap.on() log(2, "ACTION: Power On")