Skip to content
This repository has been archived by the owner on Jun 20, 2021. It is now read-only.

Commit

Permalink
YeePHP: fixed toggle() method
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkEzz committed Jan 2, 2021
1 parent 09f84a5 commit b2d156b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ All the methods are documented in the class and in the interface, here it is a g
| getBrightness | x | int | Return the current light brightness between 0 and 100 |
| getColor | x | string | return an hexadecimal representation or the light color |
| getName | x | string | Return the current light name |
| toggle (deprecated) | x | self | Toggle the light state (deprecated, use setPower instead) |
| toggle | x | self | Toggle the light state |
| setColor | int $hexColor | self | Set the light color, must be an hexadecimal string (eg: 0xFFFFFF) |
| setBrightness | int $amount | self | Set the light brightness, $amount must be between 0 and 100 |
| setName | string $name | self | Set the light name |
Expand Down
1 change: 0 additions & 1 deletion src/Interfaces/YeePHPInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public function getName(): string;
/**
* Toggle the light
*
* @deprecated Please use the setPower() method instead
* @return YeePHPInterface
*/
public function toggle(): self;
Expand Down
4 changes: 3 additions & 1 deletion src/YeePHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function commit(): bool
}

$this->jobs = [];

return $success;
}

Expand Down Expand Up @@ -320,6 +320,8 @@ protected function makeRequest(array $job): ?string
{
$res = json_decode($res, true);

var_dump($res);

if(!array_key_exists('error', $res) && array_key_exists('result', $res))
$resultStr = $res['result'][0];
}
Expand Down

0 comments on commit b2d156b

Please sign in to comment.