yeelight_adapter

package
v0.0.0-...-6312dd6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RGBToYeelight

func RGBToYeelight(color color.RGBA) int

Types

type Brightness

type Brightness struct {
	*properties.BrightnessProperty
	// contains filtered or unexported fields
}

func NewBrightness

func NewBrightness(bulb *YeelightDevice, value properties.Integer) *Brightness

func (*Brightness) SetValue

func (b *Brightness) SetValue(v properties.Integer) error

type Color

type Color struct {
	*properties.ColorProperty
	// contains filtered or unexported fields
}

func NewColor

func NewColor(bulb *YeelightDevice, value string) *Color

func (*Color) SetValue

func (on *Color) SetValue(v string) error

type ColorTemperatureProperty

type ColorTemperatureProperty struct {
	*properties.ColorTemperatureProperty
	// contains filtered or unexported fields
}

func NewColorTemperatureProperty

func NewColorTemperatureProperty(bulb *YeelightDevice, value properties.Integer) *ColorTemperatureProperty

func (ColorTemperatureProperty) SetValue

type NotifyMessage

type NotifyMessage struct {
	Method string         `json:"method"`
	Params map[string]any `json:"params"`
}

type On

type On struct {
	*properties.OnOffProperty
	// contains filtered or unexported fields
}

func NewOn

func NewOn(bulb *YeelightDevice, value bool) *On

func (*On) TurnOff

func (on *On) TurnOff() error

func (*On) TurnOn

func (on *On) TurnOn() error

type YeeColorModeProperty

type YeeColorModeProperty struct {
	*properties.ColorModeProperty
	// contains filtered or unexported fields
}

func NewColorMode

func NewColorMode(device *YeelightDevice, value string) *YeeColorModeProperty

type YeeDevice

type YeeDevice interface {
	HandleRemoved()
}

type YeelightAdapter

type YeelightAdapter struct {
	*proxy.Adapter
	// contains filtered or unexported fields
}

func NewVirtualAdapter

func NewVirtualAdapter(adapterId string) *YeelightAdapter

func (*YeelightAdapter) HandleDeviceRemoved

func (a *YeelightAdapter) HandleDeviceRemoved(device proxy.DeviceProxy)

func (*YeelightAdapter) HandleDeviceSaved

func (a *YeelightAdapter) HandleDeviceSaved(msg messages.DeviceSavedNotificationJsonData)

func (*YeelightAdapter) StartPairing

func (a *YeelightAdapter) StartPairing(timeout <-chan time.Time)

type YeelightDevice

type YeelightDevice struct {
	*devices.Light

	*yeelight.Client
	// contains filtered or unexported fields
}

func NewYeelightBulb

func NewYeelightBulb(clint *yeelight.Client, id, name, ip string) *YeelightDevice

func (*YeelightDevice) HandleRemoved

func (d *YeelightDevice) HandleRemoved()

func (*YeelightDevice) Listen

func (d *YeelightDevice) Listen(ctx context.Context) error

func (*YeelightDevice) SetCredentials

func (d *YeelightDevice) SetCredentials(username, password string) error

func (*YeelightDevice) SetPin

func (d *YeelightDevice) SetPin(pin string) error

Directories

Path Synopsis
lib

Jump to

Keyboard shortcuts

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