Merge pull request #123 from debsahu/master
fixed error in speed control from HA.
This commit is contained in:
commit
801f368373
2 changed files with 3 additions and 3 deletions
|
@ -863,7 +863,7 @@ void loop() {
|
||||||
if (mode == SET_MODE) {
|
if (mode == SET_MODE) {
|
||||||
DBG_OUTPUT_PORT.printf("SET_MODE: %d %d\n", ws2812fx_mode, mode);
|
DBG_OUTPUT_PORT.printf("SET_MODE: %d %d\n", ws2812fx_mode, mode);
|
||||||
strip.setMode(ws2812fx_mode);
|
strip.setMode(ws2812fx_mode);
|
||||||
mode = HOLD;
|
mode = SETSPEED;
|
||||||
}
|
}
|
||||||
if (mode == OFF) {
|
if (mode == OFF) {
|
||||||
// strip.setColor(0,0,0);
|
// strip.setColor(0,0,0);
|
||||||
|
@ -882,7 +882,7 @@ void loop() {
|
||||||
}
|
}
|
||||||
if (mode == SETSPEED) {
|
if (mode == SETSPEED) {
|
||||||
strip.setSpeed(convertSpeed(ws2812fx_speed));
|
strip.setSpeed(convertSpeed(ws2812fx_speed));
|
||||||
// mode = HOLD;
|
mode = HOLD;
|
||||||
}
|
}
|
||||||
if (mode == BRIGHTNESS) {
|
if (mode == BRIGHTNESS) {
|
||||||
strip.setBrightness(brightness);
|
strip.setBrightness(brightness);
|
||||||
|
|
|
@ -746,7 +746,7 @@ void checkForRequests() {
|
||||||
uint8_t json_speed = constrain((uint8_t) root["speed"], 0, 255);
|
uint8_t json_speed = constrain((uint8_t) root["speed"], 0, 255);
|
||||||
if (json_speed != ws2812fx_speed) {
|
if (json_speed != ws2812fx_speed) {
|
||||||
ws2812fx_speed = json_speed;
|
ws2812fx_speed = json_speed;
|
||||||
mode = SETSPEED;
|
if(stateOn) mode = SETSPEED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue