【文件属性】:
文件名称:色相:使用Ruby的Philips Hue
文件大小:16KB
文件格式:ZIP
更新时间:2021-02-01 00:32:26
ruby gem hue RubyRuby
色调
使用Ruby的Philips Hue灯泡。
安装
将此行添加到您的应用程序的Gemfile中:
gem 'hue'
然后执行:
$ bundle
或自己安装为:
$ gem install hue
用法
首次使用时,它将自动为您创建一个用户。 为此,您需要在过去30秒钟内按下桥上的按钮。 如果没有,它将引发异常,并告知您需要按下按钮。 只需按下按钮,然后再次运行命令。
命令行界面
$ hue all on
$ hue all off
$ hue all --hue 65280 --brightness 20
$ hue light 2 on
$ hue light 2 --brightness 20
Ruby
client = Hue :: Client . new
灯火
light = client . lights . first
light . on!
light . hue = 46920
light . color_temperature = 100
transition_time = 10 * 5 # Hue transition times are in
【文件预览】:
hue-master
----bin()
--------hue(337B)
----Readme.markdown(2KB)
----Rakefile(198B)
----.github()
--------workflows()
----test()
--------test_helper.rb(147B)
--------hue()
----LICENSE(1KB)
----hue.gemspec(1KB)
----Gemfile(51B)
----Contributing.markdown(798B)
----Todo.markdown(102B)
----.gitignore(154B)
----lib()
--------hue.rb(245B)
--------hue()