muesli/huephp
Composer 安装命令:
composer require muesli/huephp
包简介
PHP library to control the Phillips Hue lighting system
README 文档
README
PHP library to control the Philips Hue lighting system. Started out as a fork of the unmaintained phpHue class (https://github.com/danray0424/phpHue) and ended up as a complete rewrite.
Getting Started
The src/ directory contains the huephp classes and all necessary functions for interacting with the Hue hub.
Additionally, you can easily require huephp as a dependency using composer
php composer.phar require muesli/huephp ~1.0
Check out the "samples" directory. You'll find a few demos, showing you how to interact with huephp. It uses the PEST library to access Hue's RESTful API, but as a user of huephp, you don't need to worry about the details.
hue command-line tool
bin/hue is a command line lighting system controller.
./bin/hue
-i [Hue bridge's ip]
If you don't already have a valid registered key for this Hue bridge:
-g [register a new key with the Hue bridge]
Once have a registered key, you need to specify it with -k:
-k [valid key that is registered with your Hue hub]
Use it in combination with one of the following parameters:
To get information from the bridge:
-f [fetch full state from Hue hub]
-c [check light states: returns 0 when a light is off, 1 when on]
To control the bridge:
If you don't specify a light number, bin/hue will target all bulbs:
-l [light number]
Turning a light on or off:
-o [0 for turning the light off, 1 for turning it on]
To set a new color, pick one of the following options:
-n [color name (see below)]
or
-h [hue in degrees on the color circle 0-360]
-s [saturation 0-254]
-b [brightness 0-254]
or
-t [white color temp 150-500]
Additionally options are:
-r [transition time, in seconds. Decimals are legal (".1", for instance)]
-e [command to execute before changing light setting]
You need to specify an ip (-i), a key (-k) and at least one of the following options: -h, -s, -b, -t, -o or -n. If you don't specify a light, it'll set the values you specify on all of them.
If you don't have a key yet, you can register one by calling bin/hue with -g.
You can turn lights on or off with the -o switch. Any other parameter implies '-o 1'. In other words, if you specify any other parameter when the lamp is off, we'll turn it on for you.
Presets
The '-n' switch takes a one-word name for a color, and sets the selected lights to that color. It has a small list of predefined color names, and simply doesn't do anything if you give it a string it doesn't know. It currently knows red, blue, purple, green, coolwhite, and warmwhite. A '-n' parameter may be overridden in part by other parameters. For instance, "-n red -s 50" will give you a pastel red, and "-n blue -r 10" will produce a 10-second fade to blue. Note that "-n red -h 200" will override the redness of the red command with a hue of 200, which is purpleish, but it will inherit the full saturation and brightness of the "red" preset.
muesli/huephp 适用场景与选型建议
muesli/huephp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 363 次下载、GitHub Stars 达 33, 最近一次更新时间为 2014 年 12 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 muesli/huephp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 muesli/huephp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 363
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-03