moved again

This commit is contained in:
Marcus Westin 2020-01-20 14:10:30 +00:00
parent 58041b1d99
commit c078683e71

View file

@ -161,11 +161,6 @@ class PlejdService extends EventEmitter {
setTimeout(async () => { setTimeout(async () => {
await this.onDeviceConnected(connectedDevice); await this.onDeviceConnected(connectedDevice);
await this.adapter.StopDiscovery(); await this.adapter.StopDiscovery();
// After we've authenticated, we need to hook up the event listener
// for changes to lastData.
this.characteristics.lastDataProperties.on('PropertiesChanged', this.onLastDataUpdated.bind(this));
this.characteristics.lastData.StartNotify();
}, 2000); }, 2000);
} }
@ -337,6 +332,11 @@ class PlejdService extends EventEmitter {
// Start ping // Start ping
logger('onAuthenticated()'); logger('onAuthenticated()');
this.startPing(); this.startPing();
// After we've authenticated, we need to hook up the event listener
// for changes to lastData.
this.characteristics.lastDataProperties.on('PropertiesChanged', this.onLastDataUpdated.bind(this));
this.characteristics.lastData.StartNotify();
} }
async startPing() { async startPing() {