filament

package module
v0.0.0-...-5e1fd47 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 5 Imported by: 0

README

Filament Go Report Card

Filament is an unofficial Go wrapper for LIFX's HTTP API.

Build Status

branch status
develop CircleCI
master CircleCI

Installation

$ go get github.com/panicpanicpanic/filament

How To Use

Authentication

In order to access your LIFX devices, you must first have a valid access token. You can visit the LIFX Cloud page to set one up:

Using your LIFX Access Token in Filament

Once you have an access token, you use Filament like this:

import(
    "github.com/panicpanicpanic/filament"
    "github.com/panicpanicpanic/filament/lifx"
)

client := lifx.Client{
        AccessToken: "someRandomToken"
    }

_, err := filament.SomeMethod(&client)
if err != nil {
    fmt.Println("handle your error")
}

Available Methods

All methods are available in this godoc!

Contributing

Want to contribute? Just fork the repo, make a feature/bug PR and send it over! Just make sure your tests are passing :)

License

MIT

I'm not affiliated with LIFX, but they are fucking awesome, so you should buy their 💡!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateScene

func ActivateScene(client *lifx.Client, sceneUUID string, payload interface{}) (lifx.Response, error)

ActivateScene activates a scene from your LIFX account

func BreatheEffect

func BreatheEffect(client *lifx.Client, selector string, payload interface{}) (lifx.Response, error)

BreatheEffect performs a breathe effect by slowly fading between the given colors.

func Cycle

func Cycle(client *lifx.Client, selector string, payload interface{}) (lifx.Response, error)

Cycle makes the light(s) cycle to the next or previous state in a list of states

func GetLights

func GetLights(client *lifx.Client, selector string) ([]device.Device, error)

GetLights returns []device.Device that belong to your LIFX account

func GetScenes

func GetScenes(client *lifx.Client) ([]device.Scene, error)

GetScenes returns []device.Scene that belong to your LIFX account

func PulseEffect

func PulseEffect(client *lifx.Client, selector string, payload interface{}) (lifx.Response, error)

PulseEffect performs a pulse effect by quickly flashing between the given colors

func SetState

func SetState(client *lifx.Client, selector string, payload interface{}) (lifx.Response, error)

SetState sets the state of the lights within the given selector, and returns a LIFX Response

func SetStates

func SetStates(client *lifx.Client, payload interface{}) (lifx.Response, error)

SetStates sets multiple states across multiple selectors, and returns a LIFX Response

func StateDelta

func StateDelta(client *lifx.Client, selector string, payload interface{}) (lifx.Response, error)

StateDelta changes the state of the lights by the amount specified

func TogglePower

func TogglePower(client *lifx.Client, selector string) (lifx.Response, error)

TogglePower turns off lights if any of them are on, or turns them on if they are all off.

func ValidateColor

func ValidateColor(client *lifx.Client, color string) (device.Color, error)

ValidateColor returns a device.Color if a valid color string is passed

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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