devices

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Entry

func Entry(args []string)

Entry function is the entry point for the devices module.

Types

type Data

type Data struct {
	Devices []Device `json:"devices"`
}

Data struct is so annoying but necessary to use the json.Unmarshal func provided by Go Lang because of the API's use of data padding. I wish I could delete it, but I dont think I can :(

type Device

type Device struct {
	MAC          string   `json:"device"`
	Model        string   `json:"model"`
	Name         string   `json:"deviceName"`
	Controllable bool     `json:"controllable"`
	Retrievable  bool     `json:"retrievable"`
	Commands     []string `json:"supportCmds"`
}

Device struct is a map of the API's device node. The struct contains information about the user's device.

type Devices

type Devices struct {
	Data    Data   `json:"data"`
	Message string `json:"message"`
	Status  int    `json:"status"`
}

Devices struct maps to the Govee Api JSON Endpoints as of v1. Devices is a list of all the Device's that belong to an authenticated user.

func (*Devices) ComplexList

func (d *Devices) ComplexList(limit int)

ComplexList outputs the User's devices in a nice but complex way. It pretty much dumps everything the app knows about their device to the console.

func (*Devices) Get

func (d *Devices) Get(c general.Connection)

Get Fills an empty Devices object with information provided from Govee's API using the Connection that must be passed as a parameter.

func (*Devices) SimpleList

func (d *Devices) SimpleList(limit int)

SimpleList prints a simple list of Device's to the terminal, the list includes the name, model and if the device is controllable or not by this app.

Jump to

Keyboard shortcuts

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