Exemplo n.º 1
0
 /**
  * Test: Get schedulable params
  *
  * @covers \Phue\Command\SetGroupState::getSchedulableParams
  */
 public function testGetSchedulableParams()
 {
     // Build command
     $setGroupStateCmd = new SetGroupState($this->mockGroup);
     // Change alert
     $setGroupStateCmd->alert('select');
     // Ensure schedulable params are expected
     $this->assertEquals(['address' => "/api/{$this->mockClient->getUsername()}/groups/{$this->mockGroup->getId()}/action", 'method' => 'PUT', 'body' => (object) ['alert' => 'select']], $setGroupStateCmd->getSchedulableParams($this->mockClient));
 }
Exemplo n.º 2
0
Arquivo: Group.php Projeto: sqmk/phue
 /**
  * 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;
 }