Update tuya-mqtt.js

This commit is contained in:
tsightler
2020-09-25 00:34:43 -04:00
parent 311144a9ed
commit 56b87aa27e

View File

@@ -123,7 +123,7 @@ function publishDeviceTopics(device, dps) {
const topic = baseTopic + stateTopic
let state
// Only publish state updates for DPS values included in device data
if (dps.hasOwnProperty('dpsKey')) {
if (dps.hasOwnProperty(template.dpsType)) {
switch (template.dpsType) {
case "bool":
state = (dps[template.dpsKey]) ? 'ON' : 'OFF';