Commit 741d27fa by Chavee Issariyapat

fix bug

parent a4eb9e32
...@@ -44,12 +44,14 @@ const Coordinator = function(param={}) { ...@@ -44,12 +44,14 @@ const Coordinator = function(param={}) {
}); });
this.localserver.on('clientPublished', function(packet, client){ this.localserver.on('clientPublished', function(packet, client){
let deviceid = client.id.split(':')[0];
console.log('client published', client.id); console.log('client published', client.id);
let tap_topic = `@tap/shadow/update/${client.id}:${client.token}`; let tap_topic = `@tap/shadow/update/${deviceid}:${client.token}`;
let msg = packet.payload.toString(); let msg = packet.payload.toString();
that.remoteclient.publish(packet.topic, msg) that.remoteclient.publish(tap_topic, msg)
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment