Documentation ¶
Index ¶
- Constants
- func BoolToString(b bool) string
- func GetBits() string
- func GridSpacing(s1 string) string
- func HexTo2Places(h string) string
- func Line()
- func PrintBoolParagraph(s1 string, c1 color.Attribute, yes bool)
- func PrintError(s string)
- func PrintHeading(s string, c color.Attribute)
- func PrintNeutral(s string)
- func PrintStringParagraph(s1 string, s2 string, c1 color.Attribute)
- func PrintWarning(s string)
- func StringToBool(s string) bool
- type Colour
- type Connection
Constants ¶
const BuildName = "v1.1.1"
BuildName is the name of the build
const BuildNo = 3
BuildNo is the build number
const Description = "Lux is a cli for controlling and monitoring Govee lighting strips"
Description is the description
const GHRepo = "https://github.com/bandev/lux"
GHRepo is the repo url
const License = "GPL-3.0"
License is the license
Variables ¶
This section is empty.
Functions ¶
func BoolToString ¶
BoolToString converts a Boolean to a string. Makes boolean values more readable to a user. When true outputs Yes.
func GetBits ¶ added in v1.1.0
func GetBits() string
GetBits returns x64 or x86 depending on the installed version
func GridSpacing ¶
GridSpacing calculates & prints spaces in order to make grid style print statements.
func HexTo2Places ¶
HexTo2Places is used for converting the value 0 to 00. This is used for hexadecimal colour codes.
func PrintBoolParagraph ¶
PrintBoolParagraph is very specific function for printing in a format like X: [ YES / NO ]
func PrintHeading ¶
PrintHeading prints text in a unified heading format.
func PrintStringParagraph ¶
PrintStringParagraph prints text in a unified paragraph format taking into account grid spacing.
func StringToBool ¶
StringToBool converts a string to a boolean. Sorta like the reverse of BoolToString. It will convert words like on / off, true / false into boolean data. Anything else will return false.
Types ¶
type Connection ¶
Connection contains information about the connection to the Govee API such as the user's API Key & the server URL.
func (Connection) Get ¶
func (c Connection) Get(path string) []byte
Get makes a GET request to the API server with the path provided as a string. Usually a JSON object is returned in byte array form to help with parsing.
func (Connection) Put ¶
func (c Connection) Put(path string, body []byte) []byte
Put uses the PUT request to send data to the API.
func (Connection) TestKey ¶
func (c Connection) TestKey() bool
TestKey uses the devices endpoint to verify that the API Key provided is valid.