Zendure: fix battery power (#17443)
This commit is contained in:
parent
aa513c43de
commit
d7e87bf207
2 changed files with 2 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ func (c *Zendure) CurrentPower() (float64, error) {
|
|||
case "pv":
|
||||
return float64(res.SolarInputPower), nil
|
||||
case "battery":
|
||||
return float64(res.GridInputPower) - float64(res.OutputHomePower), nil
|
||||
return float64(res.PackInputPower) - float64(res.OutputPackPower), nil
|
||||
default:
|
||||
return 0, fmt.Errorf("invalid usage: %s", c.usage)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ type Data struct {
|
|||
MasterSwitch bool `json:"masterSwitch"` // true,
|
||||
OutputLimit int `json:"outputLimit"` // 0,
|
||||
OutputPackPower int `json:"outputPackPower"` // 70,
|
||||
PackInputPower int `json:"packInputPower"` // 70,
|
||||
OutputHomePower int `json:"outputHomePower"` // 70,
|
||||
PackNum int `json:"packNum"` // 1,
|
||||
PackState int `json:"packState"` // 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue