Zaptec: propagate Enable errors other than 528 (#31803)

This commit is contained in:
andig 2026-07-15 09:33:53 +02:00 • committed by GitHub
parent 526d17ff4a
commit 88b7621d90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -241,13 +241,16 @@ func (c *Zaptec) Enable(enable bool) error {
Code int
}
err := c.DoJSON(req, &res)
// ignore 528: Charging is not Paused nor Scheduled; Resume command cannot be sent
if err := c.DoJSON(req, &res); err == nil || res.Code == 528 {
if err == nil || res.Code == 528 {
c.enabled = enable
c.statusG.Reset()
return nil
}
return nil
return err
}
func (c *Zaptec) chargerUpdate(data zaptec.Update) error {