mirror of
https://github.com/lehanspb/tuya-mqtt.git
synced 2025-12-16 17:54:36 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user