Skip to content

Commit

Permalink
fix: #141 ?
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner committed Nov 11, 2019
1 parent 2ff2bd1 commit bafc561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/binding-mqtt/src/mqtt-broker-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class MqttBrokerServer implements ProtocolServer {
let topic = "/" + encodeURIComponent(name) + "/properties/" + encodeURIComponent(propertyName);
let property = thing.properties[propertyName];

thing.subscribeEvent(propertyName,
thing.observeProperty(propertyName,
// let subscription = property.subscribe(
(data) => {
let content;
Expand All @@ -115,7 +115,7 @@ export default class MqttBrokerServer implements ProtocolServer {
} catch(err) {
console.warn(`MqttServer cannot process data for Property '${propertyName}': ${err.message}`);
// subscription.unsubscribe();
thing.unsubscribeEvent(propertyName);
thing.unobserveProperty(propertyName);
return;
}
console.log(`MqttBrokerServer at ${this.brokerURI} publishing to Property topic '${propertyName}' `);
Expand Down

0 comments on commit bafc561

Please sign in to comment.