Added friendly topics for the devices behind gateway

You can now use:
tuya/gw1/lv/dps/2/command
instead of tuya/zgw1/2342cd828dfsxckkk/dps/2/command
This commit is contained in:
Alex M
2024-02-19 19:42:02 +03:00
committed by GitHub
parent 4ea2f0a58f
commit f865e259a1

View File

@@ -31,7 +31,6 @@ async function processExit(exitCode) {
}
// Get new deivce based on configured type
// For Tuya Gateway use GenericDevice
function getDevice(configDevice, mqttClient) {
const deviceInfo = {
configDevice: configDevice,
@@ -166,6 +165,11 @@ const main = async() => {
const dpsKey = splitTopic[topicLength-2]
device.processDpsKeyCommand(message, dpsKey)
break;
case 6:
const subDevDpsKey = splitTopic[topicLength-2]
const cidName = splitTopic[topicLength-4]
device.processDpsKeyWcidNameCommand(message, subDevDpsKey, cidName)
break;
}
}
} catch (e) {