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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ const getDiscoveryPayload = device => ({
|
|||
state_topic: getStateTopic(device),
|
||||
command_topic: getCommandTopic(device),
|
||||
optimistic: false,
|
||||
retain: true,
|
||||
brightness: `${device.dimmable}`,
|
||||
device: {
|
||||
identifiers: device.serialNumber,
|
||||
|
|
|
|||
8
plejd/package-lock.json
generated
8
plejd/package-lock.json
generated
|
|
@ -199,14 +199,6 @@
|
|||
"type": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"dbus": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/dbus/-/dbus-1.0.5.tgz",
|
||||
"integrity": "sha512-itMup/0lcjnwV4DULJtI8q37Nky713KE2b1QM4+W/0zlzAsMNJZURBtyENtnJc6BlHouqbur++PXWeEKDuGulg==",
|
||||
"requires": {
|
||||
"nan": "^2.13.2"
|
||||
}
|
||||
},
|
||||
"dbus-next": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/dbus-next/-/dbus-next-0.8.1.tgz",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
"@abandonware/bluetooth-hci-socket": "0.5.3-3",
|
||||
"axios": "^0.19.0",
|
||||
"buffer-xor": "^2.0.2",
|
||||
"dbus": "^1.0.5",
|
||||
"dbus-next": "^0.8.1",
|
||||
"fs": "0.0.1-security",
|
||||
"jspack": "0.0.4",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue