Daheimladen: restore safe current limit after charger reset (#31729)
This commit is contained in:
parent
843e79a725
commit
7e3da98630
1 changed files with 13 additions and 1 deletions
|
|
@ -197,8 +197,20 @@ func (wb *DaheimLaden) Status() (api.ChargeStatus, error) {
|
|||
// Enabled implements the api.Charger interface
|
||||
func (wb *DaheimLaden) Enabled() (bool, error) {
|
||||
curr, err := wb.getCurrent()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return curr >= 60, err
|
||||
// a charger restart resets the current limit to 0A which triggers
|
||||
// unauthorised autostart. restore the safe disabled value.
|
||||
if curr == 0 {
|
||||
if err := wb.setCurrent(1); err != nil {
|
||||
return false, err
|
||||
}
|
||||
curr = 1
|
||||
}
|
||||
|
||||
return curr >= 60, nil
|
||||
}
|
||||
|
||||
// Enable implements the api.Charger interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue