diff --git a/library/Phue/Command/CreateGroup.php b/library/Phue/Command/CreateGroup.php index e87d05d..1af8b44 100644 --- a/library/Phue/Command/CreateGroup.php +++ b/library/Phue/Command/CreateGroup.php @@ -101,6 +101,6 @@ public function send(Client $client) ; $r = explode('/', $response->id); - return $r[2]; + return $r[0]; } } diff --git a/library/Phue/Group.php b/library/Phue/Group.php index 919f1c4..d89b0e6 100644 --- a/library/Phue/Group.php +++ b/library/Phue/Group.php @@ -169,6 +169,33 @@ public function setOn($flag = true) return $this; } + /** + * Get alert + * + * @return string Alert mode + */ + public function getAlert() + { + return $this->attributes->action->alert; + } + /** + * Set light alert + * + * @param string $mode + * Alert mode + * + * @return self This object + */ + public function setAlert($mode = SetLightState::ALERT_LONG_SELECT) + { + $x = new SetGroupState($this); + $y = $x->alert($mode); + $this->client->sendCommand($y); + $this->attributes->action->alert = $mode; + return $this; + } + + /** * Get brightness * diff --git a/tests/Phue/Test/Command/CreateGroupTest.php b/tests/Phue/Test/Command/CreateGroupTest.php index 3dbb74d..0707b20 100644 --- a/tests/Phue/Test/Command/CreateGroupTest.php +++ b/tests/Phue/Test/Command/CreateGroupTest.php @@ -121,7 +121,7 @@ public function testSend() -> // ->will($this->returnValue((object)['id' => '/path/5'])); will($this->returnValue((object) array( - 'id' => '/path/5' + 'id' => '5' ))); // Send command and get response