effect() public method

Set effect mode
public effect ( string $mode = self::EFFECT_COLORLOOP ) : self
$mode string Effect mode
return self This object
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');
 }
Example #2
0
File: Light.php Project: sqmk/phue
 /**
  * Set effect
  *
  * @param string $mode
  *            Effect mode
  *
  * @return self This object
  */
 public function setEffect($mode = SetLightState::EFFECT_NONE)
 {
     $x = new SetLightState($this);
     $y = $x->effect($mode);
     $this->client->sendCommand($y);
     $this->attributes->state->effect = $mode;
     return $this;
 }