xy() public method

Set xy
public xy ( float $x, float $y ) : self
$x float X value
$y float Y value
return self This object
Example #1
0
 /**
  * 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);
 }
Example #2
0
File: Light.php Project: sqmk/phue
 /**
  * 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;
 }