From b22d48eca115d2f65a4ab42bae58d5f4c7460bca Mon Sep 17 00:00:00 2001 From: Adrian Zankich Date: Sat, 3 May 2014 03:31:11 -0700 Subject: [PATCH] Interval is now a time.Duration --- device.go | 3 ++- driver.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/device.go b/device.go index 4296f0b2..c00d4a79 100644 --- a/device.go +++ b/device.go @@ -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:"-"` } diff --git a/driver.go b/driver.go index 35fac7b2..38cc5f15 100644 --- a/driver.go +++ b/driver.go @@ -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 }