chore: reorder
This commit is contained in:
parent
8a4dda650d
commit
a08fe828b4
1 changed files with 15 additions and 15 deletions
|
|
@ -89,6 +89,21 @@ func NewTwc3FromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
return c, nil
|
||||
}
|
||||
|
||||
// Status implements the api.Charger interface
|
||||
func (v *Twc3) Status() (api.ChargeStatus, error) {
|
||||
status := api.StatusA // disconnected
|
||||
|
||||
res, err := v.vitalsG()
|
||||
switch {
|
||||
case res.ContactorClosed:
|
||||
status = api.StatusC
|
||||
case res.VehicleConnected:
|
||||
status = api.StatusB
|
||||
}
|
||||
|
||||
return status, err
|
||||
}
|
||||
|
||||
// Enabled implements the api.Charger interface
|
||||
func (c *Twc3) Enabled() (bool, error) {
|
||||
return verifyEnabled(c, c.enabled)
|
||||
|
|
@ -143,21 +158,6 @@ func (c *Twc3) MaxCurrent(current int64) error {
|
|||
return v.MaxCurrent(current)
|
||||
}
|
||||
|
||||
// Status implements the api.Charger interface
|
||||
func (v *Twc3) Status() (api.ChargeStatus, error) {
|
||||
status := api.StatusA // disconnected
|
||||
|
||||
res, err := v.vitalsG()
|
||||
switch {
|
||||
case res.ContactorClosed:
|
||||
status = api.StatusC
|
||||
case res.VehicleConnected:
|
||||
status = api.StatusB
|
||||
}
|
||||
|
||||
return status, err
|
||||
}
|
||||
|
||||
var _ api.ChargeRater = (*Twc3)(nil)
|
||||
|
||||
// ChargedEnergy implements the api.ChargeRater interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue