Commit d90d925e authored by waterword's avatar waterword

100 - 0,0 -100 循环亮度

parent ed2e0da9
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
var bglight = require("bglight.js"); var bglight = require("bglight.js");
var value = 0; var value = 0;
var flage = 0;
export default { export default {
data: { data: {
dynamicBindBrightnessValue:100, dynamicBindBrightnessValue:100,
...@@ -81,13 +82,24 @@ ...@@ -81,13 +82,24 @@
// wifiEventJS.connect_wifi(initWifissid, initWifipwd); // wifiEventJS.connect_wifi(initWifissid, initWifipwd);
// wifiEventJS.enableWLANSwitch(); // wifiEventJS.enableWLANSwitch();
brightnessAutoValue = 100; brightnessAutoValue = 100;
this.testTimer = this.$setInterval (this.InterValTime, 500, [], this); this.testTimer = this.$setInterval (this.InterValTime, 10, [], this);
}, },
InterValTime: function () { InterValTime: function () {
console.log("brightnessAutoValue=" + brightnessAutoValue); console.log("brightnessAutoValue=" + brightnessAutoValue);
brightnessAutoValue = (brightnessAutoValue + 1) % 101; if(brightnessAutoValue == 100){
flage = 0
}
else if(brightnessAutoValue == 0){
flage = 1
}
if(flage == 1){
brightnessAutoValue ++;
}else{
brightnessAutoValue --;
}
this.dynamicBindBrightnessValue = brightnessAutoValue; this.dynamicBindBrightnessValue = brightnessAutoValue;
this.crtBrightnessValue = brightnessAutoValue; this.crtBrightnessValue = brightnessAutoValue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment