minor fixes
This commit is contained in:
parent
ff1952cd88
commit
df4cdc1141
4 changed files with 10 additions and 10 deletions
|
|
@ -323,6 +323,10 @@ class PlejdService extends EventEmitter {
|
|||
}
|
||||
|
||||
async write(data, retry = true) {
|
||||
if (!this.plejdService || !this.characteristics.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
console.log('plejd-ble: sending ' + data.length + ' byte(s) of data to Plejd');
|
||||
const encryptedData = this._encryptDecrypt(this.cryptoKey, this.plejdService.addr, data);
|
||||
|
|
@ -480,6 +484,12 @@ class PlejdService extends EventEmitter {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!this.characteristics.auth) {
|
||||
console.log('plejd-ble: error: unable to connect to the Plejd mesh.');
|
||||
this.emit('connectFailed');
|
||||
return;
|
||||
}
|
||||
|
||||
await this.authenticate();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue