Interval is now a time.Duration
This commit is contained in:
parent
819ec4f709
commit
b22d48eca1
|
@ -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:"-"`
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue