Skip to content

Commit

Permalink
Fix slider for devices without RGB
Browse files Browse the repository at this point in the history
Fix slider for devices with one or two channels like only white or white/yellow
  • Loading branch information
arendst committed Nov 30, 2019
1 parent 09f9104 commit 5524075
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tasmota/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### 7.1.0.1 20191130

- Fix slider for devices with one or two channels like only white or white/yellow

## Released

### 7.1.0 20191129
Expand Down
8 changes: 5 additions & 3 deletions tasmota/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ const char HTTP_SCRIPT_ROOT[] PROGMEM =

const char HTTP_SCRIPT_ROOT_PART2[] PROGMEM =
"function lc(v,i,p){"
"if(v=='h'||v=='d'){" // Hue or Brightness changed so change Saturation colors too
"var sl=eb('sl4').value;"
"eb('s').style.background='linear-gradient(to right,rgb('+sl+'%%,'+sl+'%%,'+sl+'%%),hsl('+eb('sl2').value+',100%%,50%%))';"
"if(eb('s')){" // Check if Saturation is in DOM otherwise javascript fails on la()
"if(v=='h'||v=='d'){" // Hue or Brightness changed so change Saturation colors too
"var sl=eb('sl4').value;"
"eb('s').style.background='linear-gradient(to right,rgb('+sl+'%%,'+sl+'%%,'+sl+'%%),hsl('+eb('sl2').value+',100%%,50%%))';"
"}"
"}"
"la('&'+v+i+'='+p);"
"}"
Expand Down

0 comments on commit 5524075

Please sign in to comment.