Skip to content

Commit

Permalink
Merge pull request #90 from Thruio/master
Browse files Browse the repository at this point in the history
Add support for getReachable()
  • Loading branch information
sqmk committed Feb 27, 2015
2 parents 7dfdb7a + d714441 commit 2711cc4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions library/Phue/Light.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,16 @@ public function getColorMode()
return $this->attributes->state->colormode;
}

/**
* Get whether or not the bulb is reachable.
*
* @return bool
*/
public function isReachable()
{
return $this->attributes->state->reachable;
}

/**
* __toString
*
Expand Down
14 changes: 14 additions & 0 deletions tests/Phue/Test/LightTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public function setUp()
'alert' => 'none',
'effect' => 'none',
'colormode' => 'hs',
'reachable' => true,
],
];

Expand Down Expand Up @@ -415,6 +416,19 @@ public function testGetColormode()
);
}

/**
* Test: Get color mode
*
* @covers \Phue\Group::getColorMode
*/
public function testIsReachable()
{
$this->assertEquals(
$this->attributes->state->reachable,
$this->light->isReachable()
);
}

/**
* Test: toString
*
Expand Down

0 comments on commit 2711cc4

Please sign in to comment.