colorTemp() public method

Set color temperature
public colorTemp ( integer $value ) : self
$value integer Color temperature value
return self This object
Esempio n. 1
0
 /**
  * Test: Invalid color temp value
  *
  * @dataProvider providerInvalidColorTemp
  *
  * @covers \Phue\Command\SetLightState::colorTemp
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidColorTempValue($temp)
 {
     $x = new SetLightState($this->mockLight);
     $x->colorTemp($temp);
 }
Esempio n. 2
0
File: Light.php Progetto: sqmk/phue
 /**
  * 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;
 }