Merge pull request #39 from icanos/dev
more error handling and version upgrade
This commit is contained in:
commit
657ad62955
3 changed files with 12 additions and 7 deletions
15
plejd/ble.js
15
plejd/ble.js
|
|
@ -617,11 +617,16 @@ class PlejdService extends EventEmitter {
|
||||||
|
|
||||||
unsubscribeCharacteristics() {
|
unsubscribeCharacteristics() {
|
||||||
if (this.characteristics.lastData) {
|
if (this.characteristics.lastData) {
|
||||||
this.characteristics.lastData.unsubscribe((err) => {
|
try {
|
||||||
if (err) {
|
this.characteristics.lastData.unsubscribe((err) => {
|
||||||
console.log('error: could not unsubscribe from event.');
|
if (err) {
|
||||||
}
|
console.log('error: could not unsubscribe from event.');
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.log('warning: could not unsubscribe from lastData, probably already disconnected: ' + error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Plejd",
|
"name": "Plejd",
|
||||||
"version": "0.2.6",
|
"version": "0.2.7",
|
||||||
"slug": "plejd",
|
"slug": "plejd",
|
||||||
"description": "Adds support for the Swedish home automation devices from Plejd.",
|
"description": "Adds support for the Swedish home automation devices from Plejd.",
|
||||||
"url": "https://github.com/icanos/hassio-plejd/",
|
"url": "https://github.com/icanos/hassio-plejd/",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ const mqtt = require('./mqtt');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const PlejdService = require('./ble');
|
const PlejdService = require('./ble');
|
||||||
|
|
||||||
const version = "0.2.6";
|
const version = "0.2.7";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log('starting Plejd add-on v. ' + version);
|
console.log('starting Plejd add-on v. ' + version);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue