Skip to content

Commit

Permalink
fixed the drop to be empty
Browse files Browse the repository at this point in the history
  • Loading branch information
t1gr0u committed Oct 27, 2023
1 parent 20aee30 commit 24cd212
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rain-gauge-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ export class RainGaugeCard extends LitElement {
maxLevel = maxLevelOverride
}

// 180 min - 0 max
let rainLevel = 180
// 188 min - 0 max
const rainDropBoxHeight = 188
let rainLevel = rainDropBoxHeight
if (totalRainValue > 0 && totalRainValue < maxLevel) {
rainLevel = 180 - Math.round(180 / maxLevel * totalRainValue)
rainLevel = rainDropBoxHeight - Math.round(rainDropBoxHeight / maxLevel * totalRainValue)
}
if (totalRainValue >= maxLevel) {
rainLevel = 0
Expand Down

0 comments on commit 24cd212

Please sign in to comment.