From e7b4a7f8bf2749eeae41e79096a1ae2c6f7eefa2 Mon Sep 17 00:00:00 2001 From: jonofe Date: Sat, 3 Sep 2016 17:16:04 +0200 Subject: [PATCH 1/4] Bugfix --- library/Phue/Command/CreateGroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } } From c23778874b3967bd350603290d08ef89a14ca218 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 4 Sep 2016 14:20:31 +0200 Subject: [PATCH 2/4] Added alert function for HUE groups --- library/Phue/Group.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/library/Phue/Group.php b/library/Phue/Group.php index 919f1c4..5e35fd0 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 * From b669170f8ead5b1862b2901e9c79f591c4d6fb4f Mon Sep 17 00:00:00 2001 From: root Date: Sun, 4 Sep 2016 14:31:26 +0200 Subject: [PATCH 3/4] removed white space from eol --- library/Phue/Group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Phue/Group.php b/library/Phue/Group.php index 5e35fd0..d89b0e6 100644 --- a/library/Phue/Group.php +++ b/library/Phue/Group.php @@ -193,7 +193,7 @@ public function setAlert($mode = SetLightState::ALERT_LONG_SELECT) $this->client->sendCommand($y); $this->attributes->action->alert = $mode; return $this; - } + } /** From 3273bf9861e266893c9c4dd89024f70f613f80fe Mon Sep 17 00:00:00 2001 From: root Date: Sun, 4 Sep 2016 14:37:44 +0200 Subject: [PATCH 4/4] corrected corresponding test in CreateGroupTest --- tests/Phue/Test/Command/CreateGroupTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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