Skip to content

Commit

Permalink
Interval is now a time.Duration
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed May 3, 2014
1 parent 819ec4f commit b22d48e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion device.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"log"
"reflect"
"time"
)

type Device interface {
Expand All @@ -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:"-"`
}
Expand Down
5 changes: 3 additions & 2 deletions driver.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
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"`
Events map[string]chan interface{} `json:"-"`
}

type DriverInterface interface {
//Init() bool
Start() bool
Halt() bool
}

0 comments on commit b22d48e

Please sign in to comment.