HuaweiAC: use active phases api (#11346)

This commit is contained in:
andig 2023-12-30 13:49:44 +01:00 • committed by GitHub
parent a131678739
commit f0048cd09f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,13 +84,9 @@ func NewHuaweiACCharger(uri string, slaveID uint8) (api.Charger, error) {
}
func (wb *HuaweiACCharger) setCurrent(current float64) error {
var phases int
// get (expectedly) active phases from loadpoint
phases := 3
if wb.lp != nil {
phases = wb.lp.GetPhases()
}
if phases == 0 {
phases = 3
phases = wb.lp.ActivePhases()
}
b := make([]byte, 4)