A PHP client library for the Lifx HTTP api.
Via Composer
$ composer require ben-gibson/lifx-client
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);
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CONDUCT for details.
The MIT License (MIT). Please see License File for more information.