From 0bee28f987b2dcb60a379fd6c2f071d42aa0c77f Mon Sep 17 00:00:00 2001 From: neoteknic Date: Tue, 26 Jun 2018 01:03:32 +0200 Subject: [PATCH] - Add custom brithness to setRGB to Group --- library/Phue/Group.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/Phue/Group.php b/library/Phue/Group.php index 14951aa..910e96b 100644 --- a/library/Phue/Group.php +++ b/library/Phue/Group.php @@ -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 @@ -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;