Skip to content

Commit

Permalink
FIX check property
Browse files Browse the repository at this point in the history
  • Loading branch information
ggottwald committed Mar 5, 2018
1 parent 4eb8b1b commit f4f1c2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Models/Cube.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ class Cube extends Subdevice
*/
public function handleState($state)
{
if (!is_array($state)) {
return;
}

if (isset($state['rotate'])) {
$this->status = 'rotate';
$this->rotateDegrees = $state['rotate'];
} else {
$this->status = $state['status'];
$this->status = $state['status'] ?? null;
$this->rotateDegrees = null;
}

Expand Down

0 comments on commit f4f1c2e

Please sign in to comment.