/** * Test: Invalid xy value * * @dataProvider providerInvalidXY * * @covers \Phue\Command\SetLightState::xy * * @expectedException \InvalidArgumentException */ public function testInvalidXYValue($x, $y) { $_x = new SetLightState($this->mockLight); $_x->xy($x, $y); }
/** * Set XY * * @param float $x * X value * @param float $y * Y value * * @return self This object */ public function setXY($x, $y) { $_x = new SetLightState($this); $_y = $_x->xy((double) $x, (double) $y); $this->client->sendCommand($_y); // Change both internal xy and colormode state $this->attributes->state->xy = array($x, $y); $this->attributes->state->colormode = 'xy'; return $this; }