color

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entry

func Entry(args []string)

Entry point for the colour on commands. Checks the arguments and decides what is required to do.

Types

type Control

type Control struct {
	Device string     `json:"device"`
	Model  string     `json:"model"`
	Cmd    ControlCmd `json:"cmd"`
}

Control struct manages the control json data that will be send to govee.

func (*Control) Send

func (c *Control) Send(d devices.Device, conn general.Connection, color ControlCmdColor) []byte

Send sends all the data to govee to set the value of the colour

type ControlCmd

type ControlCmd struct {
	Name  string          `json:"name"`
	Value ControlCmdColor `json:"value"`
}

ControlCmd is the control command json that will be sent to govee.

type ControlCmdColor

type ControlCmdColor struct {
	R int64 `json:"r"`
	G int64 `json:"g"`
	B int64 `json:"b"`
}

ControlCmdColor is the struct for managing the RGB values for each colour.

type Response

type Response struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Response struct is for parsing the json returned by govee.

func (*Response) Fill

func (r *Response) Fill(c []byte)

Fill fills the response struct with the data provided by govee.

Jump to

Keyboard shortcuts

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