Update generator
This commit is contained in:
parent
f77689abe3
commit
dedc74f03d
|
@ -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 }
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue