/** * Test: Get schedulable params * * @covers \Phue\Command\SetLightState::getSchedulableParams */ public function testGetSchedulableParams() { // Build command $setLightStateCmd = new SetLightState($this->mockLight); // Change alert $setLightStateCmd->alert('select'); // Ensure schedulable params are expected $this->assertEquals(['address' => "/api/{$this->mockClient->getUsername()}/lights/{$this->mockLight->getId()}/state", 'method' => 'PUT', 'body' => (object) ['alert' => 'select']], $setLightStateCmd->getSchedulableParams($this->mockClient)); }
/** * Test: Get actionable params * * @covers \Phue\Command\SetLightState::getActionableParams */ public function testGetActionableParams() { // Build command $setLightStateCmd = new SetLightState($this->mockLight); // Change alert $setLightStateCmd->alert('select'); // Ensure actionable params are expected $this->assertEquals(array('address' => "/lights/{$this->mockLight->getId()}/state", 'method' => 'PUT', 'body' => (object) array('alert' => 'select')), $setLightStateCmd->getActionableParams($this->mockClient)); }
/** * Set Color temperature * * @param int $value Color temperature value * * @return self This object */ public function setColorTemp($value) { $x = new SetLightState($this); $y = $x->colorTemp((int) $value); $this->client->sendCommand($y); // Change both internal color temp and colormode state $this->attributes->state->ct = (int) $value; $this->attributes->state->colormode = 'ct'; return $this; }