// Status implements the api.Charger interface
Status implements the api.Charger interface
// Status implements the api . Charger interface
func (wb *Warp) Status() (api.ChargeStatus, error) {
	var status warp.Status
	s, err := wb.statusG()
	if err == nil {
		err = json.Unmarshal([]byte(s), &status)
	}
	res := api.StatusNone
	switch status.VehicleState {
	case 0:
		res = api.StatusA
	case 1:
		res = api.StatusB
	case 2:
		res = api.StatusC
	default:
		if err == nil {
			err = fmt.Errorf("invalid status: %d", status.VehicleState)
		}
	}
	return res, err
}
func ( wb * Warp ) Status ( ) ( api . ChargeStatus , error ) { var status warp . Status s , err := wb . statusG ( ) if err == nil { err = json . Unmarshal ( [ ] byte ( s ) , & status ) } res := api . StatusNone switch status . VehicleState { case 0 : res = api . StatusA case 1 : res = api . StatusB case 2 : res = api . StatusC default : if err == nil { err = fmt . Errorf ( " " , status . VehicleState ) } } return res , err }
Status implements the api.Charger interface
Status implements the api . Charger interface