2017 © Pedro Peláez
 

library lifx-client

PHP client library for the LIFX API (v1)

image

phlak/lifx-client

PHP client library for the LIFX API (v1)

  • Tuesday, February 13, 2018
  • by PHLAK
  • Repository
  • 1 Watchers
  • 6 Stars
  • 140 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

LIFX Client , (*1)

Join our Community Become a Sponsor One-time Donation
Latest Stable Version Total Downloads License Build Status StyleCI , (*2)

PHP client library for the LIFX API (v1) -- by, Chris Kankiewicz (@PHLAK) , (*3)


Introduction

LIFX Client is a LIFX API client library for PHP built with GuzzleHttp., (*4)

Refer to the full LIFX API documentation for more information about each method and it's available parameters., (*5)

Requirements

Install with Composer

composer require phlak/lifx-client

Initializing the Client

First, import LIFX:, (*6)

use PHLAK\LIFX;

Then instantiate the class with your LIFX OAuth 2 access token. You can generate an access token from your account settings page:, (*7)

$lifx = new LIFX\Client('YOUR_APP_TOKEN');

Usage

List one or more lights via a selector:, (*8)

$lifx->listLights($selector = 'all');

Set the state of one or more lights via a selector:, (*9)

$lifx->setState($selector, array $params);

Set multiple states across multiple selectors:, (*10)

$lifx->setStates(array $states, array $defaults = []);

Toggle the power of one or more lights via a selector:, (*11)

$lifx->togglePower($selector, $duration = 1);

Cause one or more lights to breathe via a selector:, (*12)

$lifx->breatheEffect($selector, $color, array $params = []);

Cause one or more lights to pulse via a selector:, (*13)

$lifx->pulseEffect($selector, $color, array $params = []);

Make the light(s) cycle to the next or previous state in a list of states:, (*14)

$lifx->cycle($selector, array $states, array $params = []);

Get a list of available scenes:, (*15)

$lifx->listScenes();

Activate a scene:, (*16)

$lifx->activateScene($sceneUuid, $duration = 1.0);

Validate a color string:, (*17)

$lifx->validateColor($string);

Handling Exceptions

use GuzzleHttp\Exception\ClientException;

try {
    $lifx->togglePower('id:123456789abcd');
} catch (ClientException $exception) {
    // Handle this exception here...
}

See the GuzzleHttp exceptions documentation for more details., (*18)

Changelog

A list of changes can be found on the GitHub Releases page., (*19)

Troubleshooting

For general help and support join our [Spectrum Community](https://spectrum.chat/phlaknet or reach out on Twitter., (*20)

Please report bugs to the GitHub Issue Tracker., (*21)

This project is licensed under the MIT License., (*22)

The Versions

13/02 2018

dev-master

9999999-dev

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires

23/05 2017

1.1.0

1.1.0.0

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires

27/03 2017

dev-composer-updates

dev-composer-updates

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2017

1.0.0

1.0.0.0

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires

27/02 2017

0.1.1

0.1.1.0

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires

23/02 2017

0.1.0

0.1.0.0

PHP client library for the LIFX API (v1)

  Sources   Download

MIT

The Requires

 

The Development Requires