device

package
v0.0.0-...-5e1fd47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capabilities

type Capabilities struct {
	HasColor             bool    `json:"has_color"`
	HasVariableColorTemp bool    `json:"has_variable_color_temp"`
	HasIR                bool    `json:"has_ir"`
	HasChain             bool    `json:"has_chain"`
	HasMultizone         bool    `json:"has_multizone"`
	MinKelvin            float64 `json:"min_kelvin"`
	MaxKelvin            float64 `json:"max_kelvin"`
}

Capabilities represents all of the current features a Device has

type Color

type Color struct {
	Hue        float64 `json:"hue"`
	Saturation float64 `json:"saturation"`
	Kelvin     float64 `json:"kelvin"`
	Name       string  `json:"name"`
}

Color represents which colors a Device is currently set to

type Device

type Device struct {
	ID               string    `json:"json"`
	UUID             string    `json:"uuid"`
	Label            string    `json:"label"`
	Connected        bool      `json:"connected"`
	Power            string    `json:"power"`
	Brightness       float64   `json:"brightness"`
	LastSeen         time.Time `json:"last_seen"`
	SecondsSinceSeen int       `json:"seconds_since_seen"`
	Group            Group     `json:"group"`
	Color            Color     `json:"color"`
	Location         Location  `json:"location"`
	Product          Product   `json:"product"`
}

Device represents the core fields for a LIFX light source

type Group

type Group struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Group represents which group a Device belongs to

type Location

type Location struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Location represents what Location a Device belongs to

type Product

type Product struct {
	Name         string       `json:"name"`
	Identifier   string       `json:"identifier"`
	Company      string       `json:"company"`
	Capabilities Capabilities `json:"capabilities"`
}

Product represents the type of LIFX product a Device is

type Scene

type Scene struct {
	UUID      string            `json:"uuid"`
	Name      string            `json:"name"`
	Account   map[string]string `json:"account"`
	CreatedAt time.Time         `json:"created_at"`
	UpdatedAt time.Time         `json:"updated_at"`
	States    []State           `json:"states"`
}

Scene represents currently available scenes for your LIFX bulb

type State

type State struct {
	Color      Color   `json:"color"`
	Selector   string  `json:"selector"`
	Power      string  `json:"power"`
	Fast       bool    `json:"fast"`
	Brightness float64 `json:"brightnness"`
	Duration   float64 `json:"duration"`
	Infared    float64 `json:"infared"`
}

State represents the states of a Scene

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL