emiliopedrollo/yeelight-api-client
Composer 安装命令:
composer require emiliopedrollo/yeelight-api-client
包简介
Client library for Yeelight API
README 文档
README
Yeelight-api-client is a PHP client that makes it easy to manage and handle Yeelight bulbs.
Installation
Installation is possible using Composer.
Then install the library:
composer require elberth90/yeelight-api-client
Getting started
Create YeelightClient instance
use Yeelight\YeelightClient; $client = new \Yeelight\YeelightClient();
Search for bulbs in your local network
$bulbList = $client->search();
Once you have list of available bulbs, you can perform on each bulb some actions like for example getting property of each bulb
foreach ($bulbList as $bulb) { $promise = $bulb->getProp([\Yeelight\Bulb\BulbProperties::COLOR_TEMPERATURE]); }
Each action performed on bulb return Promise, so you can perform on it
then() or done() operation.
$promise->done(function (\Yeelight\Bulb\Response $response) { // do something with response }, function (\Yeelight\Bulb\Exceptions\Exception $exception) { // log exception or whatever... });
Full documentation for an API can be found here
Contributing
See CONTRIBUTING.md for more information about contributing and developing yeelight-api-client.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-19