From 53017599b1f6fb4fd85e78bb5167da5a565387d3 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sun, 14 Feb 2016 00:23:00 -0500 Subject: Base implemention for schedule.go with structs. --- schedule.go | 42 ++++++++++++++++++++++++++++++++++++++++++ schedule_test.go | 12 ++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 schedule.go create mode 100644 schedule_test.go diff --git a/schedule.go b/schedule.go new file mode 100644 index 0000000..4588a66 --- /dev/null +++ b/schedule.go @@ -0,0 +1,42 @@ +/* +* schedule.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) collin.guarino@gmail.com +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ + +package hue + +import ( + //"fmt" +) + +type Timer struct { + Index int + Name string `json:"name",omitempty` + Description string `json:"description",omitempty` + Command CommandInfo `json:"command",omitempty` + Time string `json:"time",omitempty` + Created string `json:"created",omitempty` + Status string `json:"status",omitempty` + AutoDelete bool `json:"autodelete",omitempty` + StartTime string `json:"starttime",omitempty` +} + +type Alarm struct { + Index string + Name string `json:"name",omitempty` + Description string `json:"description",omitempty` + Command CommandInfo `json:"command",omitempty` + LocalTime string `json:"localtime",omitempty` + Time string `json:"time",omitempty` + Created string `json:"created",omitempty` + Status string `json:"status",omitempty` + AutoDelete bool `json:"autodelete",omitempty` +} + +type CommandInfo struct { + Address string `json:"address",omitempty` + Body string `json:"body",omitempty` // TODO: may be diff type + Method string `json:"method",omitempty` +} diff --git a/schedule_test.go b/schedule_test.go new file mode 100644 index 0000000..438d3fd --- /dev/null +++ b/schedule_test.go @@ -0,0 +1,12 @@ +/* +* schedule_test.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) collin.guarino@gmail.com +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ + +package hue + +import ( + //"testing" +) -- cgit v1.2.3