Merge pull request #51 from icanos/bluez
potential bug fixed and new version
This commit is contained in:
commit
7b1bbc6a92
3 changed files with 7 additions and 6 deletions
|
|
@ -450,21 +450,22 @@ class PlejdService extends EventEmitter {
|
|||
console.log('onDeviceConnected()');
|
||||
|
||||
const objects = await this.objectManager.GetManagedObjects();
|
||||
const paths = Object.keys(objects);
|
||||
let characteristics = [];
|
||||
|
||||
for (const path of Object.keys(objects)) {
|
||||
for (const path of paths) {
|
||||
const interfaces = Object.keys(objects[path]);
|
||||
if (interfaces.indexOf(GATT_CHRC_ID) > -1) {
|
||||
characteristics.push(path);
|
||||
}
|
||||
}
|
||||
|
||||
for (const path of Object.keys(objects)) {
|
||||
for (const path of paths) {
|
||||
const interfaces = Object.keys(objects[path]);
|
||||
if (interfaces.indexOf(GATT_SERVICE_ID) > -1) {
|
||||
let chPaths = [];
|
||||
for (const c of characteristics) {
|
||||
if (c[0] === '/') {
|
||||
if (c.startsWith(path + '/')) {
|
||||
chPaths.push(c);
|
||||
}
|
||||
}
|
||||
|
|
@ -485,7 +486,7 @@ class PlejdService extends EventEmitter {
|
|||
}
|
||||
|
||||
if (!this.characteristics.auth) {
|
||||
console.log('plejd-ble: error: unable to connect to the Plejd mesh.');
|
||||
console.log('plejd-ble: error: unable to enumerate characteristics.');
|
||||
this.emit('connectFailed');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "Plejd",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"slug": "plejd",
|
||||
"description": "Adds support for the Swedish home automation devices from Plejd.",
|
||||
"url": "https://github.com/icanos/hassio-plejd/",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ const mqtt = require('./mqtt');
|
|||
const fs = require('fs');
|
||||
const PlejdService = require('./ble.bluez');
|
||||
|
||||
const version = "0.3.1";
|
||||
const version = "0.3.2";
|
||||
|
||||
async function main() {
|
||||
console.log('starting Plejd add-on v. ' + version);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue