1
0
Fork 0

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.
This commit is contained in:
Joerg Elfring 2020-04-02 18:03:06 +02:00
parent d6d9ab5b4e
commit 5f4fdcc57d
2 changed files with 4 additions and 4 deletions

View file

@ -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 |

View file

@ -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")