iot-home/philips-hue-api
最新稳定版本:1.3.3
Composer 安装命令:
composer require iot-home/philips-hue-api
包简介
README 文档
README
Simple Client used to control the Philips Hue lighting system.
Use
- Register app and get key (you need to know HUB IP address)
$client = new \IoTHome\PhilipsHueApi\Hue\Client('10.0.0.5', null);
// register application
$key = $client->registerApplication('app-name');
// save key to your database and use it in a new instance of Client
- Create client with provided key and now you can control your lights
$client = new \IoTHome\PhilipsHueApi\Hue\Client('10.0.0.5', 'key');
// get all available lights
$lights = $client->getLights();
// Get light by id and turn it on
$light = $client->getLightById('abcd');
$light->setOn(true);
$client->updateLight($light);
// Get all available Rooms
$rooms = $client->getRooms();
// Get all available Zones
$rooms = $client->getZones();
Apply scene to lights:
$client = new \IoTHome\PhilipsHueApi\Hue\Client('10.0.0.5', 'key');
$scene = $client->getSceneById('abcdef12-abcd-1234-93bb-da3e0ea601d1');
$service = new \IoTHome\PhilipsHueApi\Scenes\SceneService($client);
// Method applies scene to all lights in group
$service->applyScene($scene);
统计信息
- 总下载量: 190
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-19