Skip to content

Commit

Permalink
Do not use float-computation
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed Dec 25, 2020
1 parent 1106c2a commit 1decd0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasmota/xdrv_01_webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2141,10 +2141,10 @@ void HandleWifiConfiguration(void)
uint8_t colors[2] = { 0xFF, 0xFF };
if(quality > 50) {
// Scale red component to go from yellow to green (full green)
colors[0] = 0xFF * (1.0f - 1.0f*(quality-50)/50);
colors[0] = (0xFF * (quality-50))/50;
} else {
// Scale green component to go from red to yellow (full red)
colors[1] = 0xFF * (1.0f*quality/50);
colors[1] = (0xFF * quality)/50;
}
// Print item
WSContentSend_P(PSTR("<li title='%s, Signal: %d dBm'>%s, Channel %d, <span style='color:#%02X%02X00'>Quality %d%%</span></li>"),
Expand Down

0 comments on commit 1decd0e

Please sign in to comment.