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

Commit

Permalink
Merge pull request #1 from Jonathan-Langlais/main
Browse files Browse the repository at this point in the history
Addition of features ( color temperature, hsv, color flow and save state)
  • Loading branch information
SharkEzz authored Apr 2, 2021
2 parents 0ca1a33 + 4a381d7 commit 8785ccd
Show file tree
Hide file tree
Showing 2 changed files with 392 additions and 61 deletions.
32 changes: 28 additions & 4 deletions src/Interfaces/YeePHPInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ public function getBrightness(): int;
/**
* Return the current light color
*
* @return string
* @param string $type The type of color
* @return array
*/
public function getColor(): string;
public function getColor(string $type): array;

/**
* Return the current light name
Expand All @@ -66,10 +67,26 @@ public function toggle(): self;
/**
* Set the color of the light
*
* @param int $hexColor The light color in hexadecimal (eg: 0xFFFFFF)
* @param int $color The light color value in hexadecimal, color temperature or hue (eg: 0xFFFFFF)
* @param array $params The parameters for the color change.
* @return $this
*/
public function setColor(int $color, array $params): self;

/**
* Start a color flow
*
* @param array $flowExpression Array of expressions, they must be profide duration (ms), mode (1, 2 or 7), value (color temperature or rgb hexa) and bright (0 - 100) in order
* @param string $action The action when flow is finished
* @return $this
*/
public function setColor(int $hexColor): self;
public function startColorFlow(array $flowExpression, string $action): self;

/**
* Stop the current color flow
*
*/
public function stopColorFlow(): void;

/**
* Define the desired light brightness.
Expand All @@ -95,6 +112,13 @@ public function setName(string $name): self;
*/
public function setPower(string $power): self;

/**
* Save the current state to the device memory
*
* @return $this
*/
public function setDefault(): self;

/**
* Send the parameters to the light.
* @return bool
Expand Down
Loading

0 comments on commit 8785ccd

Please sign in to comment.