saturation() public method

Set saturation
public saturation ( integer $value ) : self
$value integer Saturation value
return self This object
Example #1
0
 /**
  * Test: Invalid saturation value
  *
  * @covers \Phue\Command\SetLightState::saturation
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidSaturationValue()
 {
     $x = new SetLightState($this->mockLight);
     $x->saturation(300);
 }
Example #2
0
File: Light.php Project: sqmk/phue
 /**
  * Set saturation
  *
  * @param int $value
  *            Saturation value
  *
  * @return self This object
  */
 public function setSaturation($value)
 {
     $x = new SetLightState($this);
     $y = $x->saturation((int) $value);
     $this->client->sendCommand($y);
     // Change both saturation and color mode state
     $this->attributes->state->sat = (int) $value;
     $this->attributes->state->colormode = 'hs';
     return $this;
 }