haptic

package
v0.0.0-...-34c6a2e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenToEvents

func ListenToEvents(ctx context.Context, events chan string, hueHost, hueKey string) error

Types

type Button

type Button struct {
	ButtonReport struct {
		Event   string    `json:"event"`
		Updated time.Time `json:"updated"`
	} `json:"button_report"`
	LastEvent string `json:"last_event"`
}

type Color

type Color struct {
	Xy struct {
		X float64 `json:"x"`
		Y float64 `json:"y"`
	} `json:"xy"`
}

type ColorTemperature

type ColorTemperature struct {
	Mirek      interface{} `json:"mirek"`
	MirekValid bool        `json:"mirek_valid"`
}

type Dimming

type Dimming struct {
	Brightness float64 `json:"brightness"`
}

type Dynamics

type Dynamics struct {
	Status     string  `json:"status,omitempty"`
	Speed      float64 `json:"speed,omitempty"`
	SpeedValid bool    `json:"speed_valid,omitempty"`
}

type Event

type Event struct {
	IdV1             string           `json:"id_v1"`
	Button           Button           `json:"button,omitempty"`
	Owner            Owner            `json:"owner,omitempty"`
	Dimming          Dimming          `json:"dimming,omitempty"`
	Dynamics         Dynamics         `json:"dynamics,omitempty"`
	Color            Color            `json:"color,omitempty"`
	ColorTemperature ColorTemperature `json:"color_temperature,omitempty"`
	Temperature      Temperature      `json:"temperature,omitempty"`
	PowerState       PowerState       `json:"power_state,omitempty"`
	Status           Status           `json:"status,omitempty"`
}

type EventClient

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

func NewEventClient

func NewEventClient() *EventClient

func (*EventClient) Start

func (c *EventClient) Start(hueHost, hueKey string) error

func (*EventClient) Subscribe

func (c *EventClient) Subscribe(event string, ch chan string)

type Owner

type Owner struct {
	Rid   string `json:"rid"`
	Rtype string `json:"rtype"`
}

type PowerState

type PowerState struct {
	BatteryLevel int    `json:"battery_level"`
	BatteryState string `json:"battery_state"`
}

type Status

type Status struct {
	Active string `json:"active"`
}

type Temperature

type Temperature struct {
	Temperature       float64 `json:"temperature"`
	TemperatureReport struct {
		Changed     time.Time `json:"changed"`
		Temperature float64   `json:"temperature"`
	} `json:"temperature_report"`
	TemperatureValid bool `json:"temperature_valid"`
}

type WrappedEvent

type WrappedEvent struct {
	Timestamp time.Time `json:"creationtime"`
	Id        string    `json:"id"`
	Type      string    `json:"type"`

	Event Event `json:"data"`
}

Jump to

Keyboard shortcuts

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