Phue\Command\SetLightState::effect PHP Method

effect() public method

Set effect mode
public effect ( string $mode = self::EFFECT_COLORLOOP ) : self
$mode string Effect mode
return self This object
    public function effect($mode = self::EFFECT_COLORLOOP)
    {
        // Don't continue if mode is not valid
        if (!in_array($mode, self::getEffectModes())) {
            throw new \InvalidArgumentException("{$mode} is not a valid effect modes");
        }
        $this->params['effect'] = $mode;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * Test: Invalid effect mode
  *
  * @covers \Phue\Command\SetLightState::effect
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidEffectMode()
 {
     $x = new SetLightState($this->mockLight);
     $x->effect('invalidmode');
 }
All Usage Examples Of Phue\Command\SetLightState::effect