ben-gibson / lifx-client

A PHP client library for the Lifx HTTP api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A PHP client library for the Lifx HTTP api

License:MIT License


Languages

Language:PHP 100.0%