Interval is now a time.Duration

This commit is contained in:
Adrian Zankich 2014-05-03 03:31:11 -07:00
parent 819ec4f709
commit b22d48eca1
2 changed files with 5 additions and 3 deletions

View File

@ -4,6 +4,7 @@ import (
"errors"
"log"
"reflect"
"time"
)
type Device interface {
@ -14,7 +15,7 @@ type Device interface {
type device struct {
Name string `json:"name"`
Type string `json:"driver"`
Interval string `json:"-"`
Interval time.Duration `json:"-"`
Robot *Robot `json:"-"`
Driver DriverInterface `json:"-"`
}

View File

@ -1,7 +1,9 @@
package gobot
import "time"
type Driver struct {
Interval string `json:"interval"`
Interval time.Duration `json:"interval"`
Pin string `json:"pin"`
Name string `json:"name"`
Commands []string `json:"commands"`
@ -9,7 +11,6 @@ type Driver struct {
}
type DriverInterface interface {
//Init() bool
Start() bool
Halt() bool
}