keylight

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KelvinToMired

func KelvinToMired(kelvin int) int

func MiredToKelvin

func MiredToKelvin(mired int) int

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController() *Controller

func (*Controller) GetLight

func (c *Controller) GetLight(ip string) (*LightStatus, error)

func (*Controller) UpdateLight

func (c *Controller) UpdateLight(ip string, settings LightDetail) (*LightStatus, error)

type Light

type Light struct {
	Name string `mapstructure:"name"`
	IP   string `mapstructure:"ip"`
}

type LightConfig

type LightConfig struct {
	Light `mapstructure:",squash"`
}

type LightDetail

type LightDetail struct {
	On          int `json:"on"`
	Brightness  int `json:"brightness,omitempty"`
	Temperature int `json:"temperature,omitempty"`
}

type LightStatus

type LightStatus struct {
	Lights         []LightDetail `json:"lights,omitempty"`
	NumberOfLights int           `json:"numberOfLights,omitempty"`
}

Jump to

Keyboard shortcuts

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