Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
Issue #107, #108.
  • Loading branch information
ebaauw committed May 4, 2017
1 parent b93413a commit 75e96d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 7 additions & 5 deletions lib/HueBridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ HueBridge.prototype.accessories = function() {
// jshint -W106
this.accessoryMap = {};
this.accessoryList = [];
return this._request('get', 'philipshue/config').then(function(obj) {
// return this._request('get', '/config').then(function(obj) {
return this._request('get', '/config').then(function(obj) {
this.name = obj.name;
this.uuid_base = obj.bridgeid;
this.username = this.platform.config.users[this.uuid_base] || '';
Expand All @@ -96,15 +95,18 @@ HueBridge.prototype.accessories = function() {
);
}
break;
case undefined: // deCONZ rest api
case undefined: // deCONZ rest api v2_04_40
obj.modelid = 'deCONZ'; // HACK
obj.manufacturername = 'dresden elektronik';
this.uuid_base = obj.mac; // HACK
/* falls through */
case 'deCONZ': // deCONZ rest api
obj.manufacturername = 'dresden elektronik';
this.config.linkbutton = false;
break;
default:
this.log.error(
'%s: warning: %s: unknown bridge', this.name, obj.modelid
'%s: warning: %s: warning: ignoring unknown bridge type %j',
this.name, obj
);
break;
}
Expand Down
10 changes: 6 additions & 4 deletions lib/HueSensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ function HueSensor(bridge, id, obj) {
let buttons;
if (
this.obj.manufacturername === 'Philips' &&
this.obj.modelid === 'RWL021') {
(this.obj.modelid === 'RWL021' || this.obj.modelid === 'RWL020')
) {
buttons = ['On', 'Dim Up', 'Dim Down', 'Off'];
} else if (
this.obj.manufacturername === 'IKEA of Sweden' &&
this.obj.modelid === 'TRADFRI remote control') {
this.obj.modelid === 'TRADFRI remote control'
) {
buttons = ['On/Off', 'Dim Up', 'Dim Down', 'Previous', 'Next'];
} else {
this.log.error(
Expand Down Expand Up @@ -302,13 +304,13 @@ function HueSensor(bridge, id, obj) {
break;
case 'CLIPSwitch': // 2.1
this.log.error(
'%s: %s: unsupported sensor type %s',
'%s: %s: warning: ignoring unsupported sensor type %s',
this.bridge.name, this.resource, this.obj.type
);
break;
default:
this.log.error(
'%s: %s: unknown sensor type %j',
'%s: %s: warning: ignoring unknown sensor type %j',
this.bridge.name, this.resource, this.obj
);
break;
Expand Down

0 comments on commit 75e96d4

Please sign in to comment.