Skip to content

ben-gibson/lifx-client

Repository files navigation

Lifx client

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

A PHP client library for the Lifx HTTP api.

Install

Via Composer

$ composer require ben-gibson/lifx-client

Usage

Build the Lifx service.

$lifx = new Lifx(
    new \GuzzleHttp\Client(),
    new Configuration(
        'https://api.lifx.com',
        'v1',
        'my-token'
    ),
    new LightFactory()
);

Modify a single light.

$lights = $lifx->lights();

$light = $lights->connected()->current();

$light->turnOn();
$light->pickColour(Colour::red());
$light->maximumBrightness();

$lifx->update($light);

Modify all lights.

$state = new State(Power::on(), Brightness::maximum(), Colour::green());

$lifx->matchState(Selector::all(), $state);

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Releases

No releases published

Packages

No packages published

Languages