Easee: charger stuck in enabled state after vehicle disconnect (#9995)
This commit is contained in:
parent
449a4e2c2b
commit
ba1aeb5285
1 changed files with 6 additions and 6 deletions
|
|
@ -381,6 +381,12 @@ func (c *Easee) Enable(enable bool) (err error) {
|
|||
opMode := c.opMode
|
||||
c.mux.Unlock()
|
||||
|
||||
defer func() {
|
||||
if err == nil {
|
||||
c.enabled = enable
|
||||
}
|
||||
}()
|
||||
|
||||
// enable charger once if it's switched off
|
||||
if enablingRequired {
|
||||
data := easee.ChargerSettings{
|
||||
|
|
@ -412,12 +418,6 @@ func (c *Easee) Enable(enable bool) (err error) {
|
|||
targetCurrent = 32
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err == nil {
|
||||
c.enabled = enable
|
||||
}
|
||||
}()
|
||||
|
||||
uri := fmt.Sprintf("%s/chargers/%s/commands/%s", easee.API, c.charger, action)
|
||||
if _, err := c.postJSONAndWait(uri, nil); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue