Update generator

This commit is contained in:
Adrian Zankich 2014-06-15 17:27:51 -07:00
parent f77689abe3
commit dedc74f03d
1 changed files with 5 additions and 2 deletions

View File

@ -142,7 +142,6 @@ import (
type {{ .UpperName }}Driver struct { type {{ .UpperName }}Driver struct {
gobot.Driver gobot.Driver
Adaptor *{{ .UpperName }}Adaptor
} }
type {{ .UpperName }}Interface interface { type {{ .UpperName }}Interface interface {
@ -154,11 +153,15 @@ func New{{.UpperName}}Driver(a *{{.UpperName}}Adaptor, name string) *{{.UpperNam
Name: name, Name: name,
Events: make(map[string]*gobot.Event), Events: make(map[string]*gobot.Event),
Commands: make(map[string]func(map[string]interface{}) interface{}), Commands: make(map[string]func(map[string]interface{}) interface{}),
},
Adaptor: a, Adaptor: a,
},
} }
} }
func ({{.FirstLetter}} *{{ .UpperName }}Driver) adaptor() *{{ .UpperName }}Adaptor {
return {{ .FirstLetter }}.Driver.Adaptor.(*{{ .UpperName }}Adaptor)
}
func ({{.FirstLetter}} *{{ .UpperName }}Driver) Start() bool { return true } func ({{.FirstLetter}} *{{ .UpperName }}Driver) Start() bool { return true }
func ({{.FirstLetter}} *{{ .UpperName }}Driver) Halt() bool { return true } func ({{.FirstLetter}} *{{ .UpperName }}Driver) Halt() bool { return true }
` `