Skip to content

Commit

Permalink
- correct inheritance to prevent crashes
Browse files Browse the repository at this point in the history
- add IP address to device settings
- add app-settings page for debug
- Merge branch 'master' of github.com:RWensveen/com.broadlink

Conflicts:
	drivers/BroadlinkDriver.js
  • Loading branch information
RWensveen committed Jul 14, 2018
2 parents 50636f7 + e1b3c85 commit 0803001
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
9 changes: 7 additions & 2 deletions drivers/BroadlinkDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class BroadlinkDriver extends Homey.Driver {
this.discoveredDevices = [];
}


setCompatibilityID( id ) {
this.CompatibilityID = id;
}


/**
*
Expand All @@ -65,7 +70,7 @@ class BroadlinkDriver extends Homey.Driver {
that._communicate.destroy();
that._communicate = undefined;
} catch( err ) { ; }
});
});

socket.on( 'start_discover', function(userdata, callback ) {

Expand Down Expand Up @@ -111,7 +116,7 @@ class BroadlinkDriver extends Homey.Driver {
})
})

socket.on('list_devices', function(data, callback) {
socket.on('list_devices', function(data, callback) {
return callback(null,that.discoveredDevices);
});
}
Expand Down
9 changes: 4 additions & 5 deletions drivers/RM_plus/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

'use strict';

const BroadlinkDriver = require('./../BroadlinkDriver');
const BroadlinkRM3miniDriver = require('./../RM3_mini/driver');


class BroadlinkRMPlusDriver extends BroadlinkDriver {
class BroadlinkRMPlusDriver extends BroadlinkRM3miniDriver {

onInit() {
super.onInit({
CompatibilityID: 0x272A // RM Pro Plus 2
});
super.onInit();
this.setCompatibilityID( 0x272A ); // RM Pro Plus 2
}

}
Expand Down
9 changes: 4 additions & 5 deletions drivers/RM_pro/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

'use strict';

const BroadlinkDriver = require('./../BroadlinkDriver');
const BroadlinkRM3miniDriver = require('./../RM3_mini/driver');


class BroadlinkRMProDriver extends BroadlinkDriver {
class BroadlinkRMProDriver extends BroadlinkRM3miniDriver {

onInit() {
super.onInit({
CompatibilityID: 0x273d // RM PRO
});
super.onInit();
this.setCompatibilityID( 0x273d ); // RM PRO
}

}
Expand Down

0 comments on commit 0803001

Please sign in to comment.