brightness() 공개 메소드

Set brightness
public brightness ( integer $level = self::BRIGHTNESS_MAX ) : self
$level integer Brightness level
리턴 self This object
예제 #1
0
 /**
  * Test: Invalid brightness
  *
  * @dataProvider providerInvalidBrightness
  *
  * @covers \Phue\Command\SetLightState::brightness
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidBrightness($brightness)
 {
     $x = new SetLightState($this->mockLight);
     $x->brightness($brightness);
 }
예제 #2
0
파일: Light.php 프로젝트: sqmk/phue
 /**
  * Set brightness
  *
  * @param int $level
  *            Brightness level
  *
  * @return self This object
  */
 public function setBrightness($level = SetLightState::BRIGHTNESS_MAX)
 {
     $x = new SetLightState($this);
     $y = $x->brightness((int) $level);
     $this->client->sendCommand($y);
     $this->attributes->state->bri = (int) $level;
     return $this;
 }