saturation() 공개 메소드

Set saturation
public saturation ( integer $value ) : self
$value integer Saturation value
리턴 self This object
예제 #1
0
 /**
  * Test: Invalid saturation value
  *
  * @covers \Phue\Command\SetLightState::saturation
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidSaturationValue()
 {
     $x = new SetLightState($this->mockLight);
     $x->saturation(300);
 }
예제 #2
0
파일: Light.php 프로젝트: 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;
 }