Skip to content

Commit

Permalink
Release 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jghaanstra committed Jul 8, 2018
1 parent e2d63e8 commit 72e7295
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/yeelights/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class YeelightDevice extends Homey.Device {
let overWriteDimVal;

// Logic which will toggle between night_mode and normal_mode when brightness is set to 0 or 100 two times within 5 seconds
if(this.hasCapability('night_mode') && opts.duration === undefined) {
if (this.hasCapability('night_mode') && opts.duration === undefined) {
if (value === 0) {
if (this.dimMinTime + 5000 > Date.now()) {
const initialNightModeValue = this.getCapabilityValue('night_mode');
Expand Down Expand Up @@ -80,6 +80,7 @@ class YeelightDevice extends Homey.Device {
this.dimMinTime = 0;
this.dimMaxTime = 0;
}
}

if (typeof opts.duration !== 'undefined') {
this.sendCommand(this.getData().id, '{"id":1,"method":"set_bright","params":['+ brightness +', "smooth", '+ opts.duration +']}');
Expand Down

0 comments on commit 72e7295

Please sign in to comment.