From fb36967670856ede1c52319aa9433beb1548270a Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Fri, 28 Feb 2020 22:15:40 -0600 Subject: [PATCH] add success logic --- structs.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/structs.go b/structs.go index f038202..c4ac65a 100644 --- a/structs.go +++ b/structs.go @@ -7,6 +7,8 @@ import ( const API_BASE_URL = "https://api.lifx.com/v1" type ( + Status string + State struct { Power string `json:"power,omitempty"` Color string `json:"color,omitempty"` @@ -35,3 +37,13 @@ type ( Duration float64 `json:"duration,omitempty"` } ) + +const ( + OK Status = "ok" + TimedOut Status = "timed_out" + Offline Status = "offline" +) + +func (s Status) Success() bool { + return s == OK +}