hue

package
v0.0.0-...-aa64b73 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	InstanceName string
	HostName     string
	IpAddress    net.IP
	// contains filtered or unexported fields
}

func CreateBridge

func CreateBridge(ip net.IP) *Bridge

func DiscoverBridge

func DiscoverBridge() (*Bridge, error)

func (*Bridge) AdjustBrightness

func (b *Bridge) AdjustBrightness(id string, percentage float64) error

func (*Bridge) Authenticate

func (b *Bridge) Authenticate(appName, instanceName string) error

func (*Bridge) GetConfig

func (b *Bridge) GetConfig() (*Config, error)

func (*Bridge) GetLight

func (b *Bridge) GetLight(id string) (*Light, error)

func (*Bridge) GetLightByName

func (b *Bridge) GetLightByName(name string) (*Light, error)

func (*Bridge) GetLights

func (b *Bridge) GetLights() ([]Light, error)

func (*Bridge) SetColor

func (b *Bridge) SetColor(id string, c colorful.Color) error

func (*Bridge) ToggleLight

func (b *Bridge) ToggleLight(id string, on bool) error

type Config

type Config struct {
	Name             string      `json:"name"`
	DatastoreVersion string      `json:"datastoreversion"`
	SwVersion        string      `json:"swversion"`
	ApiVersion       string      `json:"apiversion"`
	Mac              string      `json:"mac"`
	Bridgeid         string      `json:"bridgeid"`
	FactoryNew       bool        `json:"factorynew"`
	ReplacesBridgeId interface{} `json:"replacesbridgeid"`
	ModelId          string      `json:"modelid"`
	StarterKitId     string      `json:"starterkitid"`
}

type Light

type Light struct {
	ID    string `json:"id"`
	IDV1  string `json:"id_v1"`
	Owner struct {
		Rid   string `json:"rid"`
		Rtype string `json:"rtype"`
	} `json:"owner"`
	Metadata struct {
		Name      string `json:"name"`
		Archetype string `json:"archetype"`
	} `json:"metadata"`
	On struct {
		On bool `json:"on"`
	} `json:"on"`
	Dimming struct {
		Brightness  float64 `json:"brightness"`
		MinDimLevel float64 `json:"min_dim_level"`
	} `json:"dimming"`
	DimmingDelta struct {
	} `json:"dimming_delta"`
	ColorTemperature struct {
		Mirek       int  `json:"mirek"`
		MirekValid  bool `json:"mirek_valid"`
		MirekSchema struct {
			MirekMinimum int `json:"mirek_minimum"`
			MirekMaximum int `json:"mirek_maximum"`
		} `json:"mirek_schema"`
	} `json:"color_temperature"`
	ColorTemperatureDelta struct {
	} `json:"color_temperature_delta"`
	Color struct {
		Xy struct {
			X float64 `json:"x"`
			Y float64 `json:"y"`
		} `json:"xy"`
		Gamut struct {
			Red struct {
				X float64 `json:"x"`
				Y float64 `json:"y"`
			} `json:"red"`
			Green struct {
				X float64 `json:"x"`
				Y float64 `json:"y"`
			} `json:"green"`
			Blue struct {
				X float64 `json:"x"`
				Y float64 `json:"y"`
			} `json:"blue"`
		} `json:"gamut"`
		GamutType string `json:"gamut_type"`
	} `json:"color,omitempty"`
	Dynamics struct {
		Status       string   `json:"status"`
		StatusValues []string `json:"status_values"`
		Speed        float64  `json:"speed"`
		SpeedValid   bool     `json:"speed_valid"`
	} `json:"dynamics"`
	Alert struct {
		ActionValues []string `json:"action_values"`
	} `json:"alert"`
	Signaling struct {
	} `json:"signaling"`
	Mode    string `json:"mode"`
	Type    string `json:"type"`
	Effects struct {
		StatusValues []string `json:"status_values"`
		Status       string   `json:"status"`
		EffectValues []string `json:"effect_values"`
	} `json:"effects,omitempty"`
}

Jump to

Keyboard shortcuts

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