Browse Source

Update src/light.c

Co-Authored-By: TheJakeSchmidt <TheJakeSchmidt@users.noreply.github.com>
Gerd Wachsmuth 5 years ago
parent
commit
f14f4ee08c
No account linked to committer's email
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      src/light.c

+ 11
- 0
src/light.c View File

@@ -955,7 +955,18 @@ bool light_cmd_mul_brightness(light_context_t *ctx)
955 955
         return false;
956 956
     }
957 957
 
958
+    uint64_t old_value = value;
958 959
     value *= ctx->run_params.float_value;
960
+    
961
+    // Check that we actually de/increase value
962
+    if( value == old_value ) {
963
+        if( ctx->runs_params.float_value > 1 ) {
964
+            value++;
965
+        }
966
+        if( ctx->runs_params.float_value < 1 && value > 0 ) {
967
+            value--;
968
+        }
969
+    }
959 970
 
960 971
     uint64_t mincap = _light_get_min_cap(ctx);
961 972
     if(mincap > value)