add success logic
This commit is contained in:
parent
c0c49b6d7c
commit
fb36967670
12
structs.go
12
structs.go
@ -7,6 +7,8 @@ import (
|
|||||||
const API_BASE_URL = "https://api.lifx.com/v1"
|
const API_BASE_URL = "https://api.lifx.com/v1"
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
Status string
|
||||||
|
|
||||||
State struct {
|
State struct {
|
||||||
Power string `json:"power,omitempty"`
|
Power string `json:"power,omitempty"`
|
||||||
Color string `json:"color,omitempty"`
|
Color string `json:"color,omitempty"`
|
||||||
@ -35,3 +37,13 @@ type (
|
|||||||
Duration float64 `json:"duration,omitempty"`
|
Duration float64 `json:"duration,omitempty"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
OK Status = "ok"
|
||||||
|
TimedOut Status = "timed_out"
|
||||||
|
Offline Status = "offline"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (s Status) Success() bool {
|
||||||
|
return s == OK
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user