Phue\Light::setOn PHP Method

setOn() public method

Set light on/off
public setOn ( boolean $flag = true ) : self
$flag boolean 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;
    }