device

package
v0.0.0-...-379bc4c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device interface {
	common.Device

	Handle(*packet.Packet) error
	Close() error
	Seen() time.Time
	Provisional() bool
	SetProvisional(bool)
	GetProduct() (product.Product, error)
	Discover() error
	RefreshThrottle() <-chan struct{}
	Outbound() transport.Outbound
}

func Classify

func Classify(dev Device) (Device, error)

Classify determines the underlying product of the device and returns an appropriate device implementation.

func New

func New(deviceId uint32, transport transport.Outbound, seen time.Time, token []byte) Device

type InfoResponse

type InfoResponse struct {
	Result common.DeviceInfo `json:"result"`
	ID     uint32            `json:"ID"`
}

type PowerPlug

type PowerPlug struct {
	Device
	*capability.Power
}

func NewPowerPlug

func NewPowerPlug(device Device) *PowerPlug

type Yeelight

type Yeelight struct {
	Device
	*capability.Light
	*capability.Power
}

func NewYeelight

func NewYeelight(device Device) *Yeelight

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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