// NewGoEFromConfig creates a go-e charger from generic config
NewGoEFromConfig creates a go-e charger from generic config
// NewGoEFromConfig creates a go - e charger from generic config
func NewGoEFromConfig(other map[string]interface{}) (api.Charger, error) {
	cc := struct {
		Token string
		URI   string
		Cache time.Duration
	}{}
	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}
	if cc.URI != "" && cc.Token != "" {
		return nil, errors.New("should only have one of uri/token")
	}
	if cc.URI == "" && cc.Token == "" {
		return nil, errors.New("must have one of uri/token")
	}
	return NewGoE(cc.URI, cc.Token, cc.Cache)
}
func NewGoEFromConfig ( other map [ string ] interface { } ) ( api . Charger , error ) { cc := struct { Token string URI string Cache time . Duration } { } if err := util . DecodeOther ( other , & cc ) ; err != nil { return nil , err } if cc . URI != " " && cc . Token != " " { return nil , errors . New ( " " ) } if cc . URI == " " && cc . Token == " " { return nil , errors . New ( " " ) } return NewGoE ( cc . URI , cc . Token , cc . Cache ) }
NewGoEFromConfig creates a go-e charger from generic config
NewGoEFromConfig creates a go - e charger from generic config