Fix energy calculation (#188)

This commit is contained in:
andig 2020-06-08 17:07:01 +02:00 • committed by GitHub
parent 221985ff7d
commit dc6da4416f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,7 +136,7 @@ func (c *GoE) CurrentPower() (float64, error) {
func (c *GoE) ChargedEnergy() (float64, error) {
var status goeStatusResponse
_, err := c.GetJSON(c.apiURL(goeStatus), &status)
energy := float64(status.Dws) / 3.6e6
energy := float64(status.Dws) / 3.6e5 // Deka-Watt-Seconds to kWh (100.000 == 0,277kWh)
return energy, err
}