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;
}
/** * Test: Invalid hue value * * @covers \Phue\Command\SetLightState::hue * * @expectedException \InvalidArgumentException */ public function testInvalidHueValue() { $x = new SetLightState($this->mockLight); $x->hue(70000); }