Skip to content

Commit

Permalink
GitHub #102 - Scene isActive now always returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
sqmk committed Oct 17, 2016
1 parent 1a389ae commit 6049929
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/list-scenes.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
echo 'Listing scenes:', "\n";

foreach ($client->getScenes() as $scene) {
echo "\t", "#{$scene->getId()} - {$scene->getName()}", "\n", "\t\t", "Light Ids: ", implode(
', ', $scene->getLightIds()), "\n", "\t\t", "Is active: ", $scene->isActive() ? 'Yes' : 'No', "\n";
echo "\t", "#{$scene->getId()} - {$scene->getName()}", "\n",
"\t\t", "Light Ids: ", implode(', ', $scene->getLightIds()), "\n";
}
6 changes: 4 additions & 2 deletions library/Phue/Scene.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ public function getLightIds()
/**
* Is active
*
* @return bool True if active, false if not
* @deprecated
*
* @return null This is now deprecated
*/
public function isActive()
{
return (bool) $this->attributes->active;
return null;
}

/**
Expand Down
13 changes: 1 addition & 12 deletions tests/Phue/Test/SceneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public function setUp()
2,
3,
5
),
'active' => true
)
);

// Create scene object
Expand Down Expand Up @@ -77,16 +76,6 @@ public function testGetLightIds()
$this->assertEquals($this->attributes->lights, $this->scene->getLightIds());
}

/**
* Test: Is active
*
* @covers \Phue\Scene::isActive
*/
public function testIsActive()
{
$this->assertEquals($this->attributes->active, $this->scene->isActive());
}

/**
* Test: toString
*
Expand Down

0 comments on commit 6049929

Please sign in to comment.