on() 공개 메소드

Set on parameter
public on ( boolean $flag = true ) : self
$flag boolean True if on, false if not
리턴 self This object
예제 #1
0
파일: Light.php 프로젝트: sqmk/phue
 /**
  * Set light on/off
  *
  * @param bool $flag
  *            True for on, false for off
  *
  * @return self This object
  */
 public function setOn($flag = true)
 {
     $x = new SetLightState($this);
     $y = $x->on((bool) $flag);
     $this->client->sendCommand($y);
     $this->attributes->state->on = (bool) $flag;
     return $this;
 }