Update to work with OpenHAB 2.4 MQTT Bindings (#8)

* Update tuya-mqtt.js

* Update tuya-mqtt.js

* Revert "Update tuya-mqtt.js"

This reverts commit 2ecd4260b163093a5886ced280ec57dc6d9f5145.

* Revert "Update tuya-mqtt.js"

This reverts commit 9f093db868c0af6cedbd98762f5885cdd844cd53.

* Updates for OpenHAB 2.4 MQTT binding

Update for OpenHAB 2.4 MQTT binding to act on message in addition to topic

* Update README.md

* Update README.md
This commit is contained in:
tsightler
2019-01-10 03:22:28 -05:00
committed by TheAgentK
parent 3b63fda413
commit 2c7ed22e14
2 changed files with 36 additions and 5 deletions

View File

@@ -76,7 +76,11 @@ mqtt_client.on('message', function (topic, message) {
if (exec == "command") {
var status = topic[6];
device.onoff(status);
if ( status == null ) {
device.onoff(message);
} else {
device.onoff(status);
}
}
if (exec == "color") {
var color = message;