name() public method

Set name
public name ( string $name ) : self
$name string Name
return self This object
 /**
  * Test: Send command
  *
  * @covers \Phue\Command\SetGroupAttributes::__construct
  * @covers \Phue\Command\SetGroupAttributes::name
  * @covers \Phue\Command\SetGroupAttributes::lights
  * @covers \Phue\Command\SetGroupAttributes::send
  */
 public function testSend()
 {
     // Build command
     $setGroupAttributesCmd = new SetGroupAttributes($this->mockGroup);
     // Set expected payload
     $this->stubTransportSendRequestWithPayload((object) ['name' => 'Dummy!', 'lights' => [3]]);
     // Change name and lights
     $setGroupAttributesCmd->name('Dummy!')->lights([3])->send($this->mockClient);
 }
Example #2
0
File: Group.php Project: sqmk/phue
 /**
  * Set name of group
  *
  * @param string $name
  *
  * @return self This object
  */
 public function setName($name)
 {
     $x = new SetGroupAttributes($this);
     $y = $x->name((string) $name);
     $this->client->sendCommand($y);
     $this->attributes->name = (string) $name;
     return $this;
 }