当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::getTransport方法代码示例

本文整理汇总了PHP中Phue\Client::getTransport方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::getTransport方法的具体用法?PHP Client::getTransport怎么用?PHP Client::getTransport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phue\Client的用法示例。


在下文中一共展示了Client::getTransport方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: send

 /**
  * Send command
  *
  * @param Client $client
  *            Phue Client
  *
  * @return Light[] List of Light objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/lights");
     $lights = array();
     foreach ($response as $lightId => $attributes) {
         $lights[$lightId] = new Light($lightId, $attributes, $client);
     }
     return $lights;
 }
开发者ID:sqmk,项目名称:phue,代码行数:18,代码来源:GetLights.php

示例2: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Group[] List of Group objects
  */
 public function send(Client $client)
 {
     // Get response
     $results = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/groups");
     $groups = [];
     foreach ($results as $groupId => $attributes) {
         $groups[$groupId] = new Group($groupId, $attributes, $client);
     }
     return $groups;
 }
开发者ID:wardcraigj,项目名称:gametime,代码行数:17,代码来源:GetGroups.php

示例3: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Schedule[] List of Schedule objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/schedules");
     $schedules = [];
     foreach ($response as $scheduleId => $attributes) {
         $schedules[$scheduleId] = new Schedule($scheduleId, $attributes, $client);
     }
     return $schedules;
 }
开发者ID:wardcraigj,项目名称:gametime,代码行数:17,代码来源:GetSchedules.php

示例4: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return bool True if authorized, false if not
  */
 public function send(Client $client)
 {
     // Get response
     try {
         $client->getTransport()->sendRequest("/api/{$client->getUsername()}");
     } catch (UnauthorizedUserException $e) {
         return false;
     }
     return true;
 }
开发者ID:bendspoons,项目名称:Phue,代码行数:17,代码来源:IsAuthorized.php

示例5: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Rule[] List of Rule objects
  */
 public function send(Client $client)
 {
     // Get response
     $results = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/rules");
     $rules = [];
     foreach ($results as $ruleId => $attributes) {
         $rules[$ruleId] = new Rule($ruleId, $attributes, $client);
     }
     return $rules;
 }
开发者ID:bendspoons,项目名称:Phue,代码行数:17,代码来源:GetRules.php

示例6: send

 /**
  * Send command
  *
  * @param Client $client
  *            Phue Client
  *
  * @return Sensor[] List of Sensor objects
  */
 public function send(Client $client)
 {
     // Get response
     $results = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/sensors");
     $sensors = array();
     foreach ($results as $sensorId => $attributes) {
         $sensors[$sensorId] = new Sensor($sensorId, $attributes, $client);
     }
     return $sensors;
 }
开发者ID:sqmk,项目名称:phue,代码行数:18,代码来源:GetSensors.php

示例7: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return array List of timezones
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequestBypassBodyValidation("/api/{$client->getUsername()}/info/timezones");
     $timezones = [];
     foreach ($response as $timezone) {
         $timezones[] = $timezone;
     }
     return $timezones;
 }
开发者ID:bendspoons,项目名称:Phue,代码行数:17,代码来源:GetTimezones.php

示例8: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return self This object
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/lights/new");
     $this->lastScan = $response->lastscan;
     // Remove scan from response
     unset($response->lastscan);
     // Iterate through left over properties as lights
     foreach ($response as $lightId => $light) {
         $this->lights[$lightId] = $light->name;
     }
     return $this;
 }
开发者ID:wardcraigj,项目名称:gametime,代码行数:20,代码来源:GetNewLights.php

示例9: send

 /**
  * Send command
  *
  * @param Client $client
  *            Phue Client
  *
  * @return User[] List of User objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/config");
     // Return empty list if no users
     if (!isset($response->whitelist)) {
         return array();
     }
     $users = array();
     foreach ($response->whitelist as $username => $attributes) {
         $users[$username] = new User($username, $attributes, $client);
     }
     return $users;
 }
开发者ID:sqmk,项目名称:phue,代码行数:22,代码来源:GetUsers.php

示例10: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Light[] List of Light objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest($client->getUsername());
     // Return empty list if no lights
     if (!isset($response->lights)) {
         return [];
     }
     $lights = [];
     foreach ($response->lights as $lightId => $attributes) {
         $lights[$lightId] = new Light($lightId, $attributes, $client);
     }
     return $lights;
 }
开发者ID:Mahlstrom,项目名称:Phue,代码行数:21,代码来源:GetLights.php

示例11: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Group[] List of Group objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest($client->getUsername());
     // Return empty list if no groups
     if (!isset($response->groups)) {
         return [];
     }
     $groups = [];
     foreach ($response->groups as $groupId => $attributes) {
         $groups[$groupId] = new Group($groupId, $attributes, $client);
     }
     return $groups;
 }
开发者ID:Mahlstrom,项目名称:Phue,代码行数:21,代码来源:GetGroups.php

示例12: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return Schedule[] List of Schedule objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest($client->getUsername());
     // Return empty list if no schedules
     if (!isset($response->schedules)) {
         return [];
     }
     $schedules = [];
     foreach ($response->schedules as $scheduleId => $attributes) {
         $schedules[$scheduleId] = new Schedule($scheduleId, $attributes, $client);
     }
     return $schedules;
 }
开发者ID:Mahlstrom,项目名称:Phue,代码行数:21,代码来源:GetSchedules.php

示例13: send

 /**
  * Send command
  *
  * @param Client $client
  *            Phue Client
  *
  * @return string Scene Id
  */
 public function send(Client $client)
 {
     $body = (object) array('name' => $this->name, 'lights' => $this->lights);
     if ($this->transitionTime !== null) {
         $body->transitiontime = $this->transitionTime;
     }
     $client->getTransport()->sendRequest("/api/{$client->getUsername()}/scenes/{$this->id}", TransportInterface::METHOD_PUT, $body);
     return $this->id;
 }
开发者ID:sqmk,项目名称:phue,代码行数:17,代码来源:CreateScene.php

示例14: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return mixed|void
  */
 public function send(Client $client)
 {
     $client->getTransport()->sendRequest("{$client->getUsername()}/config", TransportInterface::METHOD_PUT, (object) $this->config);
 }
开发者ID:Mahlstrom,项目名称:Phue,代码行数:11,代码来源:SetBridgeConfig.php

示例15: send

 /**
  * Send command
  *
  * @param Client $client Phue Client
  *
  * @return \stdClass Authentication response
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest('/api', TransportInterface::METHOD_POST, $this->buildRequestData($client));
     return $response;
 }
开发者ID:bendspoons,项目名称:Phue,代码行数:13,代码来源:CreateUser.php


注:本文中的Phue\Client::getTransport方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。