dsteiner23/phillips-hue-connection

Phillips Hue API integration

dev-master 2016-08-16 20:31 UTC

This package is not auto-updated.

Last update: 2024-11-23 20:42:12 UTC


README

Packagist License Build Status Latest Stable Version

phillips-hue-connection

Provides basic functionality for the Philllips Hue debug API

Installation

composer require dsteiner23/phillips-hue-connection

Autoloading

Register vendor autoloader and doctrine somewhere in your bootstraping file

require __DIR__ . '/vendor/autoload.php';

Configuration

The configuration is optional and can be used to overwrite caching defaults

$config = [
    'cache_enabled' => false, // default to true
    'cache_dir' => __DIR__ . '/yourDir' // default to ROOT_DIR/cache
];

Usage

$lightSwitch = \DSteiner23\Light\Factory\LightSwitchFactory::build(
    '192.168.100.1',
    'abcedefghijklmno',
    $config
);

// Change saturation, brightness and color of a single bulb
$lightSwitch->switchState($id, $saturation, $brightness, $hue);

// Switches a single bulb on
$lightSwitch->switchOn($id);

// Switches a single bulb off
$lightSwitch->switchOff($id);

// Get an instance of DSteiner23\Light\Models\Lights, representing all Bulbs connected to the Bridge
$lightSwitch->getLights();

*$id: The unique Id of your Bulb
*$saturation: integer 0-255
*$brightness: integer 0-255
*$hue: The color 0 - 65000