1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-29 13:49:14 +08:00

38 lines
690 B
Go
Raw Normal View History

2014-05-02 17:22:05 -05:00
package pebble
import (
"github.com/hybridgroup/gobot"
)
type PebbleDriver struct {
gobot.Driver
Adaptor *PebbleAdaptor
}
type PebbleInterface interface {
}
func NewPebble(adaptor *PebbleAdaptor) *PebbleDriver {
d := new(PebbleDriver)
d.Events = make(map[string]chan interface{})
d.Adaptor = adaptor
d.Commands = []string{
"PublishEventC",
}
return d
}
func (me *PebbleDriver) Init() bool {
me.Events["button"] = make(chan interface{})
return true
}
func (me *PebbleDriver) Start() bool { return true }
func (me *PebbleDriver) Halt() bool { return true }
func (sd *PebbleDriver) PublishEvent(name string, data string) {
gobot.Publish(sd.Events[name], data)
}