PHP Class Phue\Group

Inheritance: implements phue\LightInterface
ファイルを表示 Open project: sqmk/phue

Protected Properties

Property Type Description
$attributes stdClass Group attributes
$client Client Phue client
$id integer Id

Public Methods

Method Description
__construct ( integer $id, stdClass $attributes, Client $client ) Construct a Phue Group object
__toString ( ) : string __toString
delete ( ) Delete group
getAlert ( ) : string Get alert
getBrightness ( ) : integer Get brightness
getColorMode ( ) : string Get color mode of group
getColorTemp ( ) : integer Get Color temperature
getEffect ( ) : string Get effect mode
getHue ( ) : integer Get hue
getId ( ) : integer Get group Id
getLightIds ( ) : array Get light ids
getName ( ) : string Get assigned name of Group
getRGB ( ) : array Get calculated RGB
getSaturation ( ) : integer Get saturation
getType ( ) : string Get type
getXY ( ) : array Get XY
isOn ( ) : boolean Is the group on?
setAlert ( string $mode = SetLightState::ALERT_LONG_SELECT ) : self Set light alert
setBrightness ( integer $level = SetLightState::BRIGHTNESS_MAX ) : self Set brightness
setColorTemp ( integer $value ) : self Set Color temperature
setEffect ( string $mode = SetLightState::EFFECT_NONE ) : self Set effect
setHue ( integer $value ) : self Set hue
setLights ( array $lights ) : self Set lights
setName ( string $name ) : self Set name of group
setOn ( boolean $flag = true ) : self Set group lights on/off
setRGB ( integer $red, integer $green, integer $blue ) : self Set XY and brightness calculated from RGB
setSaturation ( integer $value ) : self Set saturation
setScene ( mixed $scene ) : self Set scene on group
setXY ( float $x, float $y ) : self Set XY

Method Details

__construct() public method

Construct a Phue Group object
public __construct ( integer $id, stdClass $attributes, Client $client )
$id integer Id
$attributes stdClass Group attributes
$client Client Phue client

__toString() public method

__toString
public __toString ( ) : string
return string Group Id

delete() public method

Delete group
public delete ( )

getAlert() public method

Get alert
public getAlert ( ) : string
return string Alert mode

getBrightness() public method

Get brightness
public getBrightness ( ) : integer
return integer Brightness level

getColorMode() public method

Get color mode of group
public getColorMode ( ) : string
return string Color mode

getColorTemp() public method

Get Color temperature
public getColorTemp ( ) : integer
return integer Color temperature value

getEffect() public method

Get effect mode
public getEffect ( ) : string
return string effect mode

getHue() public method

Get hue
public getHue ( ) : integer
return integer Hue value

getId() public method

Get group Id
public getId ( ) : integer
return integer Group id

getLightIds() public method

Get light ids
public getLightIds ( ) : array
return array List of light ids

getName() public method

Get assigned name of Group
public getName ( ) : string
return string Name of Group

getRGB() public method

Get calculated RGB
public getRGB ( ) : array
return array red, green, blue key/value

getSaturation() public method

Get saturation
public getSaturation ( ) : integer
return integer Saturation value

getType() public method

Get type
public getType ( ) : string
return string Group type

getXY() public method

Get XY
public getXY ( ) : array
return array X, Y key/value

isOn() public method

Is the group on?
public isOn ( ) : boolean
return boolean True if on, false if not

setAlert() public method

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

setBrightness() public method

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

setColorTemp() public method

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

setEffect() public method

Set effect
public setEffect ( string $mode = SetLightState::EFFECT_NONE ) : self
$mode string Effect mode
return self This object

setHue() public method

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

setLights() public method

Set lights
public setLights ( array $lights ) : self
$lights array Light ids or Light objects
return self This object

setName() public method

Set name of group
public setName ( string $name ) : self
$name string
return self This object

setOn() public method

Set group lights on/off
public setOn ( boolean $flag = true ) : self
$flag boolean True for on, false for off
return self This object

setRGB() public method

Set XY and brightness calculated from RGB
public setRGB ( integer $red, integer $green, integer $blue ) : self
$red integer Red value
$green integer Green value
$blue integer Blue value
return self This object

setSaturation() public method

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

setScene() public method

Set scene on group
public setScene ( mixed $scene ) : self
$scene mixed Scene id or Scene object
return self This object

setXY() public method

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

Property Details

$attributes protected_oe property

Group attributes
protected stdClass $attributes
return stdClass

$client protected_oe property

Phue client
protected Client,phue $client
return Client

$id protected_oe property

Id
protected int $id
return integer