chore: correct variable name
This commit is contained in:
parent
3c67c1b1e0
commit
94193714da
1 changed files with 4 additions and 4 deletions
|
|
@ -55,11 +55,11 @@ func (s *Estimator) Reset() {
|
|||
|
||||
// RemainingChargeDuration returns the estimated remaining duration
|
||||
func (s *Estimator) RemainingChargeDuration(targetSoc int, chargePower float64) time.Duration {
|
||||
hours := s.RemainingChargeEnergy(targetSoc) * 1e3 / chargePower
|
||||
if math.IsInf(hours, 0) {
|
||||
hours = 0
|
||||
energy := s.RemainingChargeEnergy(targetSoc) * 1e3 / chargePower
|
||||
if math.IsInf(energy, 0) {
|
||||
energy = 0
|
||||
}
|
||||
return time.Duration(float64(time.Hour) * hours).Round(time.Second)
|
||||
return time.Duration(float64(time.Hour) * energy).Round(time.Second)
|
||||
}
|
||||
|
||||
// RemainingChargeEnergy returns the remaining charge energy in kWh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue