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:
parent
d6d9ab5b4e
commit
5f4fdcc57d
2 changed files with 4 additions and 4 deletions
|
@ -35,8 +35,8 @@ These topics are reported from the device:
|
||||||
These topics can control the device:
|
These topics can control the device:
|
||||||
|
|
||||||
| CMD Topic | Values expected | Meaning |
|
| CMD Topic | Values expected | Meaning |
|
||||||
|-----------------------------|------------------|-------------------------------|
|
|--------------------------------------------|------------------------------|----------------------------------------------------------------------------|
|
||||||
| `{mqtt_topic}/CMD/power` | on/off | Turn the device on or off |
|
| `{mqtt_topic}/CMD/devicePower` | on/off | Turn the device on or off |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ def on_mqttMessage(client, userdata, message):
|
||||||
mqttMsgData = message.payload.decode("utf-8")
|
mqttMsgData = message.payload.decode("utf-8")
|
||||||
mqttMsgTopic = message.topic
|
mqttMsgTopic = message.topic
|
||||||
log(2, "RECEIVED: " + mqttMsgTopic + ":" + mqttMsgData)
|
log(2, "RECEIVED: " + mqttMsgTopic + ":" + mqttMsgData)
|
||||||
if ( mqttMsgTopic == mqtt_cmdTopic+"power" ):
|
if ( mqttMsgTopic == mqtt_cmdTopic+"devicePower" ):
|
||||||
if (mqttMsgData == "on"):
|
if (mqttMsgData == "on"):
|
||||||
ap.on()
|
ap.on()
|
||||||
log(2, "ACTION: Power On")
|
log(2, "ACTION: Power On")
|
||||||
|
|
Reference in a new issue