Skip to content

Commit

Permalink
Merge pull request #110 from jonofe/master
Browse files Browse the repository at this point in the history
Bugfix + Added Alert() function for HUE groups
  • Loading branch information
sqmk authored Sep 5, 2016
2 parents 6b8ebf3 + 3273bf9 commit 2503ea2
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/Phue/Command/CreateGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ public function send(Client $client)
;

$r = explode('/', $response->id);
return $r[2];
return $r[0];
}
}
27 changes: 27 additions & 0 deletions library/Phue/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Phue/Test/Command/CreateGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2503ea2

Please sign in to comment.