hue() public method

Set hue
public hue ( integer $value ) : self
$value integer Hue value
return self This object
Example #1
0
 /**
  * Test: Invalid hue value
  *
  * @covers \Phue\Command\SetLightState::hue
  *
  * @expectedException \InvalidArgumentException
  */
 public function testInvalidHueValue()
 {
     $x = new SetLightState($this->mockLight);
     $x->hue(70000);
 }
Example #2
0
File: Light.php Project: sqmk/phue
 /**
  * Set hue
  *
  * @param int $value
  *            Hue value
  *
  * @return self This object
  */
 public function setHue($value)
 {
     $x = new SetLightState($this);
     $y = $x->hue((int) $value);
     $this->client->sendCommand($y);
     // Change both hue and color mode state
     $this->attributes->state->hue = (int) $value;
     $this->attributes->state->colormode = 'hs';
     return $this;
 }