OpenWB: fix out of sync
This commit is contained in:
parent
1d7e25f866
commit
67bf75de8e
1 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ func init() {
|
|||
// OpenWB configures generic charger and charge meter for an openWB loadpoint
|
||||
type OpenWB struct {
|
||||
current int64
|
||||
enabled bool
|
||||
// enabledG func() (int64, error)
|
||||
statusG func() (string, error)
|
||||
currentS func(int64) error
|
||||
|
|
@ -172,12 +173,14 @@ func (m *OpenWB) Enable(enable bool) error {
|
|||
current = m.current
|
||||
}
|
||||
|
||||
m.enabled = current > 0
|
||||
|
||||
return m.currentS(current)
|
||||
}
|
||||
|
||||
func (m *OpenWB) Enabled() (bool, error) {
|
||||
// current, err := m.enabledG()
|
||||
return m.current > 0, nil
|
||||
return m.enabled, nil
|
||||
}
|
||||
|
||||
func (m *OpenWB) Status() (api.ChargeStatus, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue