go-hue-interface/state.go
Wlad Meixner b7c06e801c cleanup
2019-02-09 18:00:41 +01:00

25 lines
537 B
Go

package main
import "fmt"
// -------------------------------------------------------------
// ~ Interfaces & Types
// -------------------------------------------------------------
type BridgeState struct {
Lights map[string]*Light `json:"lights"`
}
func (l *Light) String() string {
return fmt.Sprintf("Name=\"%s\" Model=\"%s\" On=\"%x\" XY=\"%x\" \n", l.Name, l.ModelID, l.State.On, l.State.XY)
}
func (bs *BridgeState) String() string {
str := ""
for k, l := range bs.Lights {
str += k + ": " + l.String()
}
return str
}