Permalink
Browse files

GitHub #47 - Use attributes terms to match Hue documentation.

  • Loading branch information...
sqmk committed Apr 3, 2013
1 parent 555b08c commit 867b1528c3fd6555837743478fef148c7c49731f
View
@@ -17,11 +17,11 @@
class Bridge
{
/**
- * Bridge details
+ * Bridge attributes
*
* @var stdClass
*/
- protected $details;
+ protected $attributes;
/**
* Phue client
@@ -33,12 +33,12 @@ class Bridge
/**
* Construct a Phue Bridge object
*
- * @param stdClass $details Bridge details
+ * @param stdClass $attributes Bridge attributes
*/
- public function __construct(\stdClass $details, Client $client)
+ public function __construct(\stdClass $attributes, Client $client)
{
- $this->details = $details;
- $this->client = $client;
+ $this->attributes = $attributes;
+ $this->client = $client;
}
/**
@@ -48,7 +48,7 @@ public function __construct(\stdClass $details, Client $client)
*/
public function getName()
{
- return $this->details->name;
+ return $this->attributes->name;
}
/**
@@ -66,7 +66,7 @@ public function setName($name)
)
);
- $this->details->name = (string) $name;
+ $this->attributes->name = (string) $name;
return $this;
}
@@ -78,7 +78,7 @@ public function setName($name)
*/
public function getMacAddress()
{
- return $this->details->mac;
+ return $this->attributes->mac;
}
/**
@@ -88,7 +88,7 @@ public function getMacAddress()
*/
public function isDhcpEnabled()
{
- return (bool) $this->details->dhcp;
+ return (bool) $this->attributes->dhcp;
}
/**
@@ -98,7 +98,7 @@ public function isDhcpEnabled()
*/
public function getIpAddress()
{
- return $this->details->ipaddress;
+ return $this->attributes->ipaddress;
}
/**
@@ -108,7 +108,7 @@ public function getIpAddress()
*/
public function getNetmask()
{
- return $this->details->netmask;
+ return $this->attributes->netmask;
}
/**
@@ -118,7 +118,7 @@ public function getNetmask()
*/
public function getGateway()
{
- return $this->details->gateway;
+ return $this->attributes->gateway;
}
/**
@@ -128,7 +128,7 @@ public function getGateway()
*/
public function getProxyAddress()
{
- return $this->details->proxyaddress;
+ return $this->attributes->proxyaddress;
}
/**
@@ -138,7 +138,7 @@ public function getProxyAddress()
*/
public function getProxyPort()
{
- return $this->details->proxyport;
+ return $this->attributes->proxyport;
}
/**
@@ -148,7 +148,7 @@ public function getProxyPort()
*/
public function getUtcDate()
{
- return $this->details->UTC;
+ return $this->attributes->UTC;
}
/**
@@ -158,7 +158,7 @@ public function getUtcDate()
*/
public function getSoftwareVersion()
{
- return $this->details->swversion;
+ return $this->attributes->swversion;
}
/**
@@ -168,7 +168,7 @@ public function getSoftwareVersion()
*/
public function isLinkButtonOn()
{
- return (bool) $this->details->linkbutton;
+ return (bool) $this->attributes->linkbutton;
}
/**
@@ -178,6 +178,6 @@ public function isLinkButtonOn()
*/
public function arePortalServicesEnabled()
{
- return (bool) $this->details->portalservices;
+ return (bool) $this->attributes->portalservices;
}
}
@@ -44,10 +44,10 @@ public function __construct($groupId)
public function send(Client $client)
{
// Get response
- $details = $client->getTransport()->sendRequest(
+ $attributes = $client->getTransport()->sendRequest(
"{$client->getUsername()}/groups/{$this->groupId}"
);
- return new Group($this->groupId, $details, $client);
+ return new Group($this->groupId, $attributes, $client);
}
}
@@ -38,8 +38,8 @@ public function send(Client $client)
$groups = [];
- foreach ($response->groups as $groupId => $details) {
- $groups[$groupId] = new Group($groupId, $details, $client);
+ foreach ($response->groups as $groupId => $attributes) {
+ $groups[$groupId] = new Group($groupId, $attributes, $client);
}
return $groups;
@@ -44,10 +44,10 @@ public function __construct($lightId)
public function send(Client $client)
{
// Get response
- $details = $client->getTransport()->sendRequest(
+ $attributes = $client->getTransport()->sendRequest(
"{$client->getUsername()}/lights/{$this->lightId}"
);
- return new Light($this->lightId, $details, $client);
+ return new Light($this->lightId, $attributes, $client);
}
}
@@ -38,8 +38,8 @@ public function send(Client $client)
$lights = [];
- foreach ($response->lights as $lightId => $details) {
- $lights[$lightId] = new Light($lightId, $details, $client);
+ foreach ($response->lights as $lightId => $attributes) {
+ $lights[$lightId] = new Light($lightId, $attributes, $client);
}
return $lights;
@@ -38,8 +38,8 @@ public function send(Client $client)
$schedules = [];
- foreach ($response->schedules as $scheduleId => $details) {
- $schedules[$scheduleId] = new Schedule($scheduleId, $details, $client);
+ foreach ($response->schedules as $scheduleId => $attributes) {
+ $schedules[$scheduleId] = new Schedule($scheduleId, $attributes, $client);
}
return $schedules;
@@ -38,8 +38,8 @@ public function send(Client $client)
$users = [];
- foreach ($response->whitelist as $username => $details) {
- $users[$username] = new User($username, $details, $client);
+ foreach ($response->whitelist as $username => $attributes) {
+ $users[$username] = new User($username, $attributes, $client);
}
return $users;
Oops, something went wrong.

0 comments on commit 867b152

Please sign in to comment.