From 72e72952b4478f917020b635623b65a8ab96c993 Mon Sep 17 00:00:00 2001
From: jghaanstra <jghaanstra@gmail.com>
Date: Sun, 8 Jul 2018 22:25:36 +0200
Subject: [PATCH] Release 2.7.0

---
 drivers/yeelights/device.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/yeelights/device.js b/drivers/yeelights/device.js
index e3e83a3..2abb826 100644
--- a/drivers/yeelights/device.js
+++ b/drivers/yeelights/device.js
@@ -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');
@@ -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 +']}');