From 1563aa78fcfaf2788d06cb9a7bb07b3f3fd9c889 Mon Sep 17 00:00:00 2001 From: Adrian Zankich Date: Sun, 15 Dec 2013 14:26:16 -0800 Subject: [PATCH] Properly set default interval --- device.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/device.go b/device.go index c5f57061..8a15ac98 100644 --- a/device.go +++ b/device.go @@ -17,6 +17,11 @@ func NewDevice(driver interface{}, r *Robot) *Device { d := new(Device) d.Name = reflect.ValueOf(driver).Elem().FieldByName("Name").String() d.Robot = r + interval := reflect.ValueOf(driver).Elem().FieldByName("Interval").String() + if interval == "" { + interval = "0.1s" + } + reflect.ValueOf(driver).Elem().FieldByName("Interval").SetString(interval) d.Driver = driver return d }