Phue\Command\SetLightState::hue PHP Method

hue() public method

Set hue
public hue ( integer $value ) : self
$value integer Hue value
return self This object
    public function hue($value)
    {
        // Don't continue if hue value is invalid
        if (!(self::HUE_MIN <= $value && $value <= self::HUE_MAX)) {
            throw new \InvalidArgumentException("Hue value must be between " . self::HUE_MIN . " and " . self::HUE_MAX);
        }
        $this->params['hue'] = (int) $value;
        return $this;
    }

Usage Example

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);
 }
All Usage Examples Of Phue\Command\SetLightState::hue