|
@@ 61-67 (lines=7) @@
|
| 58 |
|
* @param string $selector Selector used to filter lights. Defaults to `all`. |
| 59 |
|
* @return \Psr\Http\Message\StreamInterface |
| 60 |
|
*/ |
| 61 |
|
public function getLights($selector = 'all') |
| 62 |
|
{ |
| 63 |
|
$request = new Request('GET', 'lights/' . $selector); |
| 64 |
|
$response = $this->sendRequest($request); |
| 65 |
|
|
| 66 |
|
return $response->getBody(); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
/** |
| 70 |
|
* Toggle off lights if they are on, or turn them on if they are off. |
|
@@ 76-82 (lines=7) @@
|
| 73 |
|
* @param string $selector Selector used to filter lights. Defaults to `all`. |
| 74 |
|
* @return \Psr\Http\Message\StreamInterface |
| 75 |
|
*/ |
| 76 |
|
public function toggleLights($selector = 'all') |
| 77 |
|
{ |
| 78 |
|
$request = new Request('POST', 'lights/' . $selector . '/toggle'); |
| 79 |
|
$response = $this->sendRequest($request); |
| 80 |
|
|
| 81 |
|
return $response->getBody(); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
/** |
| 85 |
|
* Turn lights on or off. |