Skip to content

Commit

Permalink
feat: added support for model 'ceiling1'
Browse files Browse the repository at this point in the history
My lamp has the model id 'ceiling1'. I expect this ceiling light to be the same as ceiling lights with model 'ceiling' so I added code to default all 'ceilingX' lights to 'ceiling' when it is not a model that has a different implementation (like 'ceiling4')
  • Loading branch information
BasKiers committed Jun 30, 2018
1 parent 543802e commit 3230d9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/yeelights/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const typeCapabilityMap = {
'color' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'stripe' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'bslamp' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'ceiling' : [ 'onoff', 'dim', 'light_temperature', 'light_mode' ],
'ceiling' : [ 'onoff', 'dim', 'light_temperature', 'light_mode', 'night_mode' ],
'ceiling4' : [ 'onoff', 'dim', 'light_hue', 'light_saturation', 'light_temperature', 'light_mode' ],
'desklamp' : [ 'onoff', 'dim', 'light_temperature', 'light_mode' ]
}
Expand Down Expand Up @@ -42,7 +42,11 @@ class YeelightDriver extends Homey.Driver {
var name = Homey.__('yeelight_led_strip')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'bslamp') {
var name = Homey.__('yeelight_bedside_lamp')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'ceiling' || result[i].model == 'ceiling4') {
} else if (result[i].model.startsWith('ceiling')) {
if(result[i].model !== 'ceiling4') {
// Default the ceiling light to the default ceiling light.
result[i].model = 'ceiling';
}
var name = Homey.__('yeelight_ceiling_light')+ ' (' + result[i].address + ')';
} else if (result[i].model == 'desklamp') {
var name = Homey.__('yeelight_desklamp')+ ' (' + result[i].address + ')';
Expand Down

0 comments on commit 3230d9a

Please sign in to comment.