func (v *Provider) Status() (api.ChargeStatus, error) {
	res, err := v.statusG()
	if res, ok := res.(Status); err == nil && ok {
		if len(res.Energy) == 1 {
			status := api.StatusA

			e := res.Energy[0]
			if e.Charging.Plugged {
				status = api.StatusB

				if strings.ToLower(e.Charging.Status) == "inprogress" {
					status = api.StatusC
				}
			}

			return status, nil
		}

		err = api.ErrNotAvailable
	}

	return api.StatusNone, err
}
// Status implements the api.ChargeState interface
Status implements the api.ChargeState interface
// Status implements the api . ChargeState interface
func (v *Provider) Status() (api.ChargeStatus, error) {
	res, err := v.statusG()
	if res, ok := res.(Status); err == nil && ok {
		if len(res.Energy) == 1 {
			status := api.StatusA
			e := res.Energy[0]
			if e.Charging.Plugged {
				status = api.StatusB
				if strings.ToLower(e.Charging.Status) == "inprogress" {
					status = api.StatusC
				}
			}
			return status, nil
		}
		err = api.ErrNotAvailable
	}
	return api.StatusNone, err
}
func ( v * Provider ) Status ( ) ( api . ChargeStatus , error ) { res , err := v . statusG ( ) if res , ok := res . ( Status ) ; err == nil && ok { if len ( res . Energy ) == 1 { status := api . StatusA e := res . Energy [ 0 ] if e . Charging . Plugged { status = api . StatusB if strings . ToLower ( e . Charging . Status ) == " " { status = api . StatusC } } return status , nil } err = api . ErrNotAvailable } return api . StatusNone , err }
Status implements the api.ChargeState interface
Status implements the api . ChargeState interface