crhg/remo-client

自然API客户端

v1.0.0 2018-05-30 05:42 UTC

This package is auto-updated.

Last update: 2024-09-21 20:41:38 UTC


README

读取/写入Nature Remo

此PHP包由Swagger Codegen项目自动生成,项目地址:https://github.com/swagger-api/swagger-codegen

  • API版本:1.0.0
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5及以后版本

安装与使用

Composer

要使用Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/crhg/remo-client.git"
    }
  ],
  "require": {
    "crhg/remo-client": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请按照安装过程进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
$config = Crhg\RemoClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new Crhg\RemoClient\Api\DefaultApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$appliances = "appliances_example"; // string | List of all appliances' IDs comma separated

try {
    $apiInstance->applianceOrdersPost($appliances);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->applianceOrdersPost: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI都是相对于https://api.nature.global/1

模型文档

授权文档

oauth2

  • 类型:OAuth
  • 流程:accessCode
  • 授权URLhttps://api.nature.global/oauth2/auth
  • 作用域:
  • basic.read:只读访问用户资料(不包括电子邮件)、Remos、设备、信号。
  • basic:读写访问用户资料(不包括电子邮件)、Remos、设备、信号。
  • sendir:通过Remo发送红外信号。
  • detectappliance:从红外信号中检测空调型号。

作者