Skip to content

Commit

Permalink
- Add custom brithness to setRGB to Group
Browse files Browse the repository at this point in the history
  • Loading branch information
neoteknic committed Jun 25, 2018
1 parent 89a3a34 commit 0bee28f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions library/Phue/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ public function getRGB()
*
* @return self This object
*/
public function setRGB($red, $green, $blue)
public function setRGB($red, $green, $blue,$bri=null)
{
$x = new SetGroupState($this);
$y = $x->rgb((int) $red, (int) $green, (int) $blue);
$y = $x->rgb((int) $red, (int) $green, (int) $blue,$bri);
$this->client->sendCommand($y);

// Change internal xy, brightness and colormode state
Expand All @@ -366,7 +366,13 @@ public function setRGB($red, $green, $blue)
$xy['x'],
$xy['y']
);
$this->attributes->action->bri = $xy['bri'];
if($bri===null){
$this->attributes->action->bri = $bri;
}
else{
$this->attributes->action->bri = $xy['bri'];
}

$this->attributes->action->colormode = 'xy';

return $this;
Expand Down

0 comments on commit 0bee28f

Please sign in to comment.