commit
381157138e
3 changed files with 27 additions and 16 deletions
33
plejd/ble.js
33
plejd/ble.js
|
|
@ -253,17 +253,28 @@ class PlejdService extends EventEmitter {
|
||||||
|
|
||||||
clearInterval(this.pingRef);
|
clearInterval(this.pingRef);
|
||||||
|
|
||||||
this.device.removeAllListeners('servicesDiscover');
|
if (this.device) {
|
||||||
this.device.removeAllListeners('connect');
|
this.device.removeAllListeners('servicesDiscover');
|
||||||
this.device.removeAllListeners('disconnect');
|
this.device.removeAllListeners('connect');
|
||||||
this.characteristics.auth.removeAllListeners('read');
|
this.device.removeAllListeners('disconnect');
|
||||||
this.characteristics.auth.removeAllListeners('write');
|
}
|
||||||
this.characteristics.data.removeAllListeners('read');
|
if (this.characteristics.auth) {
|
||||||
this.characteristics.data.removeAllListeners('write');
|
this.characteristics.auth.removeAllListeners('read');
|
||||||
this.characteristics.lastData.removeAllListeners('read');
|
this.characteristics.auth.removeAllListeners('write');
|
||||||
this.characteristics.lastData.removeAllListeners('write');
|
}
|
||||||
this.characteristics.ping.removeAllListeners('read');
|
if (this.characteristics.data) {
|
||||||
this.characteristics.ping.removeAllListeners('write');
|
this.characteristics.data.removeAllListeners('read');
|
||||||
|
this.characteristics.data.removeAllListeners('write');
|
||||||
|
}
|
||||||
|
if (this.characteristics.lastData) {
|
||||||
|
this.characteristics.lastData.removeAllListeners('read');
|
||||||
|
this.characteristics.lastData.removeAllListeners('write');
|
||||||
|
}
|
||||||
|
if (this.characteristics.ping) {
|
||||||
|
this.characteristics.ping.removeAllListeners('read');
|
||||||
|
this.characteristics.ping.removeAllListeners('write');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.connectEventHooked = false;
|
this.connectEventHooked = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Plejd",
|
"name": "Plejd",
|
||||||
"version": "0.2.5",
|
"version": "0.2.6",
|
||||||
"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.5";
|
const version = "0.2.6";
|
||||||
|
|
||||||
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