/** * Test: Send command * * @covers \Phue\Command\SetGroupState::__construct * @covers \Phue\Command\SetGroupState::send */ public function testSend() { // Build command $setGroupStateCmd = new SetGroupState($this->mockGroup); // Set expected payload $this->stubTransportSendRequestWithPayload((object) ['ct' => '300']); // Change color temp and set state $setGroupStateCmd->colorTemp(300)->send($this->mockClient); }
/** * Set Color temperature * * @param int $value * Color temperature value * * @return self This object */ public function setColorTemp($value) { $x = new SetGroupState($this); $y = $x->colorTemp((int) $value); $this->client->sendCommand($y); // Change both internal color temp and colormode state $this->attributes->action->ct = (int) $value; $this->attributes->action->colormode = 'ct'; return $this; }