crhg / remo-client
自然API客户端
v1.0.0
2018-05-30 05:42 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: >=1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
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
模型文档
- 空调
- 空调参数
- 空调范围
- 空调范围模式
- 空调范围模式列表
- 空气方向
- 空气量
- 设备
- 设备型号
- 设备型号及参数
- 设备类型
- 按钮
- 日期时间
- 设备
- 设备核心
- 设备最新事件
- 设备列表
- ID
- 图片
- 操作模式
- 传感器值
- 信号
- 温度
- 用户
授权文档
oauth2
- 类型:OAuth
- 流程:accessCode
- 授权URL:https://api.nature.global/oauth2/auth
- 作用域:
- basic.read:只读访问用户资料(不包括电子邮件)、Remos、设备、信号。
- basic:读写访问用户资料(不包括电子邮件)、Remos、设备、信号。
- sendir:通过Remo发送红外信号。
- detectappliance:从红外信号中检测空调型号。