Giter Club home page Giter Club logo

lfx's Introduction

lfx

LIFX cli tool written in Haskell

Usage:

Usage: lfx [-s|--selector SELECTOR] COMMAND
  You can control your lights via lan protocol or via internet

Available options:
  -s,--selector SELECTOR   Apply command to lights matching the SELECTOR
  -h,--help                Show this help text

Available commands:
  on                       Turn on the lights
  off                      Turn off the lights
  toggle                   Toggle the lights
  ls                       List the lights
  brightness               Set the brightness of the lights
  +                        Increase the brightness of the lights by PERCENT
  -                        Decrease the brightness of the lights by PERCENT
  color                    Set COLOR for the lights
  token                    Set the LIFX token

Configure:

To manage your lights you need to generate and set lifx token first:

$ lfx token <YOUR_TOKEN_HERE>
LIFX token written to ~/.lfxtoken

Compile:

  • Install stack
  • Clone and build this project:
$ git clone https://github.com/23ua/lfx
$ cd lfx
$ stack build

# to install binary:
$ stack install

# to run:
$ lfx

Examples:

List lights:

$ lfx ls
d071d111812e :: Hall :: 15%
d071d1142312 :: Bedroom :: 5%

# format:
# id :: label :: brightness

Increase/decrease brightness:

# +10%
$ lfx + 10

# -5%
$ lfx - 5

Set lights brightness:

# Set to 10%
$ lfx brightness 10

# Set to 100%
$ lfx brightness 100

On/off lights:

# on/off all lights:
$ lfx on
$ lfx off

# or by label:
$ lfx off label:Bedroom

# or even id:
$ lfx on d071d1142312

Toggle lights:

$ lfx toggle
$ lfx toggle label:Bedroom
$ lfx toggle d071d1142312

Set color:

$ lfx color red

lfx's People

Contributors

23ua avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.