Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- type Cmd
- type Color
- func Aqua() Color
- func Blue() Color
- func Brown() Color
- func Cyan() Color
- func DarkBlue() Color
- func Gold() Color
- func Gray() Color
- func Green() Color
- func GreenYellow() Color
- func Indigo() Color
- func Lime() Color
- func Magenta() Color
- func Maroon() Color
- func Navy() Color
- func Olive() Color
- func Orange() Color
- func Pink() Color
- func Purple() Color
- func Red() Color
- func Silver() Color
- func Teal() Color
- func Violet() Color
- func White() Color
- func Yellow() Color
- type ColorTem
- type Device
- func (d *Device) Control(cmd string, value interface{}) (DeviceControlRequest, error)
- func (d *Device) SetBrightness(brightness int) (DeviceControlRequest, error)
- func (d *Device) SetColor(color Color) (DeviceControlRequest, error)
- func (d *Device) SetColorTem(colorTem int) (DeviceControlRequest, error)
- func (d *Device) State() DeviceStateRequest
- func (d *Device) TurnOff() (DeviceControlRequest, error)
- func (d *Device) TurnOn() (DeviceControlRequest, error)
- type DeviceControlBody
- type DeviceControlRequest
- type DeviceListRequest
- type DeviceStateRequest
- type Devices
- type GoveeRequest
- type GoveeResponse
- type Properties
- type Range
- type ResponseData
Constants ¶
View Source
const Version = "0.0.1"
Variables ¶
View Source
var (
ErrUnsupportedCmd = errors.New("unsupported command")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
APIKey string
}
func (*Client) ListDevices ¶
func (c *Client) ListDevices() DeviceListRequest
func (*Client) Run ¶
func (c *Client) Run(request GoveeRequest) (GoveeResponse, error)
type Color ¶
func GreenYellow ¶
func GreenYellow() Color
type Device ¶
type Device struct { Device string `json:"device"` Model string `json:"model"` DeviceName string `json:"deviceName"` Controllable bool `json:"controllable"` Retrievable bool `json:"retrievable"` SupportCmds []string `json:"supportCmds"` Properties Properties `json:"properties"` }
func (*Device) Control ¶
func (d *Device) Control(cmd string, value interface{}) (DeviceControlRequest, error)
func (*Device) SetBrightness ¶
func (d *Device) SetBrightness(brightness int) (DeviceControlRequest, error)
func (*Device) SetColorTem ¶
func (d *Device) SetColorTem(colorTem int) (DeviceControlRequest, error)
func (*Device) State ¶
func (d *Device) State() DeviceStateRequest
func (*Device) TurnOff ¶
func (d *Device) TurnOff() (DeviceControlRequest, error)
func (*Device) TurnOn ¶
func (d *Device) TurnOn() (DeviceControlRequest, error)
type DeviceControlBody ¶
type DeviceControlRequest ¶
type DeviceControlRequest struct { Endpoint string Method string Body DeviceControlBody }
func (DeviceControlRequest) GetBody ¶
func (d DeviceControlRequest) GetBody() interface{}
func (DeviceControlRequest) GetEndpoint ¶
func (d DeviceControlRequest) GetEndpoint() string
func (DeviceControlRequest) GetMethod ¶
func (d DeviceControlRequest) GetMethod() string
func (DeviceControlRequest) GetParams ¶
func (d DeviceControlRequest) GetParams() map[string]string
type DeviceListRequest ¶
func (DeviceListRequest) GetBody ¶
func (d DeviceListRequest) GetBody() interface{}
func (DeviceListRequest) GetEndpoint ¶
func (d DeviceListRequest) GetEndpoint() string
func (DeviceListRequest) GetMethod ¶
func (d DeviceListRequest) GetMethod() string
func (DeviceListRequest) GetParams ¶
func (d DeviceListRequest) GetParams() map[string]string
type DeviceStateRequest ¶
func (DeviceStateRequest) GetBody ¶
func (d DeviceStateRequest) GetBody() interface{}
func (DeviceStateRequest) GetEndpoint ¶
func (d DeviceStateRequest) GetEndpoint() string
func (DeviceStateRequest) GetMethod ¶
func (d DeviceStateRequest) GetMethod() string
func (DeviceStateRequest) GetParams ¶
func (d DeviceStateRequest) GetParams() map[string]string
type GoveeRequest ¶
type GoveeResponse ¶
type GoveeResponse struct { Code int `json:"code"` Message string `json:"message"` Data ResponseData `json:"data"` }
func (GoveeResponse) Device ¶
func (g GoveeResponse) Device() string
func (GoveeResponse) Devices ¶
func (g GoveeResponse) Devices() Devices
func (GoveeResponse) Model ¶
func (g GoveeResponse) Model() string
func (GoveeResponse) Properties ¶
func (g GoveeResponse) Properties() []map[string]interface{}
type Properties ¶
type Properties struct {
ColorTem ColorTem `json:"colorTem"`
}
Click to show internal directories.
Click to hide internal directories.