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

Commit

Permalink
Add method to stop the current color flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan-Langlais committed Apr 2, 2021
1 parent 106b3bb commit 011ce83
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Interfaces/YeePHPInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ public function setColor(int $color, array $params): self;
*/
public function startColorFlow(array $flowExpression, string $action): self;

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

/**
* Define the desired light brightness.
Expand Down
16 changes: 15 additions & 1 deletion src/YeePHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class YeePHP implements YeePHPInterface
'set_default',
'set_ct_abx',
'set_hsv',
'start_cf'
'start_cf',
'stop_cf'
];

/**
Expand Down Expand Up @@ -259,6 +260,19 @@ public function startColorFlow(array $flowExpression, string $action = self::DED
return $this;
}

/**
* @inheritDoc
*/
public function stopColorFlow(): void
{
$job = $this->createJobArray('stop_cf', []);

$res = $this->makeRequest($job);

if (!$res)
throw new Exception('Error during stoping color flow');
}

/**
* @inheritDoc
*/
Expand Down

0 comments on commit 011ce83

Please sign in to comment.