Phue\Command\SetLightState::colorTemp PHP Method

colorTemp() public method

Set color temperature
public colorTemp ( integer $value ) : self
$value integer Color temperature value
return self This object
    public function colorTemp($value)
    {
        // Don't continue if color temperature is invalid
        if (!(self::COLOR_TEMP_MIN <= $value && $value <= self::COLOR_TEMP_MAX)) {
            throw new \InvalidArgumentException("Color temperature value must be between " . self::COLOR_TEMP_MIN . " and " . self::COLOR_TEMP_MAX);
        }
        $this->params['ct'] = $value;
        return $this;
    }

Usage Example

Example #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);
 }
All Usage Examples Of Phue\Command\SetLightState::colorTemp