Zaptec: propagate Enable errors other than 528 (#31803)
This commit is contained in:
parent
526d17ff4a
commit
88b7621d90
1 changed files with 5 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue