Git Product home page Git Product logo

pifx's Introduction

PyPI

A Python library for the LIFX cloud HTTP API

Installing PIFX

Install PIFX using pip:

  • pip install pifx

Install PIFX from source:

  • git clone https://github.com/cydrobolt/pifx.git
  • cd pifx
  • python setup.py install

Using PIFX

Create an API key

Importing PIFX in your Python file:

  • from pifx import PIFX

Creating a PIFX instance:

  • p = PIFX('API_KEY_GOES_HERE')

Performing PIFX actions:

import pifx

p = pifx.PIFX(api_key='API_KEY_GOES_HERE')

p.toggle_power() # toggle all lights
p.toggle_power('label:Bedroom') # toggle light with label "Bedroom"

p.set_state(color='blue', brightness='0.85') # set brightness to 85% and color to blue
p.pulse_lights(color='red', period=2.5) # pulse lights with a period of 2.5 seconds

Read the docs for full usage instructions.

Hacking on PIFX

Running tests:

  • pip install nose
  • nosetests

Contributing:

  • We appreciate contributions from all users.
  • Fork the project, add your changes, and make a pull request.
  • Thank you!

Other information

PIFX is an open source library not affiliated or endorsed by LIFX ®

 Copyright © 2015-2018 Chaoyi Zha <[email protected]>

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

pifx's People

Contributors

arusahni avatar camuthig avatar cydrobolt avatar dependabot[bot] avatar mclarkk avatar philosowaffle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pifx's Issues

URL encode arguments

URL encode certain arguments (e.g label:Hello World) without encoding the : to ensure that spaces and special symbols are passed correctly.
Use six.moves.urllib.parse.quote_plus(arg)

Infrared support

Should be simple, would need to add support for infrared argument in certain methods.

Can you make this for Elgato?

Wondering if you can make this for the Elgato stream deck?

https://www.elgato.com/en/gaming/stream-deck

I know it's possible to still point to the script by using the "open" command on the deck, but would be way easier if we could just drag and drop. Someone made a plugin for the Nanoleaf which is on the Elgato plugins site. Be cool to have LIFX too!

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.