PHP Class Phue\Command\SetLightState

Inheritance: implements Phue\Command\CommandInterface, implements Phue\Command\SchedulableInterface
Show file Open project: sqmk/phue Class Usage Examples

Protected Properties

Property Type Description
$lightId string Light Id
$params array State parameters

Public Methods

Method Description
__construct ( mixed $light ) Constructs a command
alert ( string $mode = self::ALERT_LONG_SELECT ) : self Set alert parameter
brightness ( integer $level = self::BRIGHTNESS_MAX ) : self Set brightness
colorTemp ( integer $value ) : self Set color temperature
effect ( string $mode = self::EFFECT_COLORLOOP ) : self Set effect mode
getActionableParams ( Client $client ) : array Get actionable params
getAlertModes ( ) : array Get alert modes
getEffectModes ( ) : array Get effect modes
hue ( integer $value ) : self Set hue
on ( boolean $flag = true ) : self Set on parameter
rgb ( integer $red, integer $green, integer $blue ) : self Sets xy and brightness calculated from RGB
saturation ( integer $value ) : self Set saturation
send ( Client $client ) Send command
transitionTime ( double $seconds ) : self Transition time
xy ( float $x, float $y ) : self Set xy

Method Details

__construct() public method

Constructs a command
public __construct ( mixed $light )
$light mixed Light Id or Light object

alert() public method

Set alert parameter
public alert ( string $mode = self::ALERT_LONG_SELECT ) : self
$mode string Alert mode
return self This object

brightness() public method

Set brightness
public brightness ( integer $level = self::BRIGHTNESS_MAX ) : self
$level integer Brightness level
return self This object

colorTemp() public method

Set color temperature
public colorTemp ( integer $value ) : self
$value integer Color temperature value
return self This object

effect() public method

Set effect mode
public effect ( string $mode = self::EFFECT_COLORLOOP ) : self
$mode string Effect mode
return self This object

getActionableParams() public method

Get actionable params
public getActionableParams ( Client $client ) : array
$client Phue\Client Phue Client
return array Key/value pairs of params

getAlertModes() public static method

Get alert modes
public static getAlertModes ( ) : array
return array List of alert modes

getEffectModes() public static method

Get effect modes
public static getEffectModes ( ) : array
return array List of color modes

hue() public method

Set hue
public hue ( integer $value ) : self
$value integer Hue value
return self This object

on() public method

Set on parameter
public on ( boolean $flag = true ) : self
$flag boolean True if on, false if not
return self This object

rgb() public method

Sets xy and brightness calculated from RGB
public rgb ( integer $red, integer $green, integer $blue ) : self
$red integer Red value
$green integer Green value
$blue integer Blue value
return self This object

saturation() public method

Set saturation
public saturation ( integer $value ) : self
$value integer Saturation value
return self This object

send() public method

Send command
public send ( Client $client )
$client Phue\Client Phue Client

transitionTime() public method

Transition time
public transitionTime ( double $seconds ) : self
$seconds double Time in seconds
return self This object

xy() public method

Set xy
public xy ( float $x, float $y ) : self
$x float X value
$y float Y value
return self This object

Property Details

$lightId protected property

Light Id
protected string $lightId
return string

$params protected property

State parameters
protected array $params
return array