lights 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +56 -0
- data/Rakefile +6 -0
- data/bin/lights +302 -0
- data/lib/lights.rb +142 -0
- data/lib/lights/bridge.rb +21 -0
- data/lib/lights/bulb.rb +25 -0
- data/lib/lights/bulbstate.rb +183 -0
- data/lib/lights/exception.rb +23 -0
- data/lib/lights/group.rb +16 -0
- data/lib/lights/loggerconfig.rb +5 -0
- data/lib/lights/sensor.rb +31 -0
- data/lib/lights/version.rb +3 -0
- data/lights.gemspec +27 -0
- data/spec/bridge_spec.rb +28 -0
- data/spec/bulb_spec.rb +32 -0
- data/spec/bulbstate_spec.rb +432 -0
- data/spec/features/rue.feature +26 -0
- data/spec/features/support/setup.rb +1 -0
- data/spec/group_spec.rb +23 -0
- metadata +142 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
Feature: Lights
|
2
|
+
|
3
|
+
Scenario: No command
|
4
|
+
When I run `lights`
|
5
|
+
Then the output should contain "Must specify a command."
|
6
|
+
Scenario: List Default
|
7
|
+
When I run `lights list`
|
8
|
+
Then the output should contain "[1]"
|
9
|
+
|
10
|
+
Scenario: List Hue bulbs
|
11
|
+
When I run `lights list lights`
|
12
|
+
Then the output should contain "[1]"
|
13
|
+
|
14
|
+
Scenario: List Hue groups
|
15
|
+
When I run `lights list groups`
|
16
|
+
Then the output should contain "[1]"
|
17
|
+
|
18
|
+
Scenario: List Hue sensors
|
19
|
+
When I run `lights list sensors`
|
20
|
+
Then the output should contain "[1]"
|
21
|
+
|
22
|
+
# This test is failing because OptionParser is casting the string as an integer (0)
|
23
|
+
# Scenario: Incorrect parameters to set
|
24
|
+
# When I run `lights set -l all -h test`
|
25
|
+
# Then the output should contain "incorrect"
|
26
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'aruba/cucumber'
|
data/spec/group_spec.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'lights'
|
2
|
+
|
3
|
+
describe Group do
|
4
|
+
it "properly parses input parameters" do
|
5
|
+
data = {
|
6
|
+
"key1" => "value 1",
|
7
|
+
"key2" => "value 2",
|
8
|
+
}
|
9
|
+
group = Group.new(1,data)
|
10
|
+
group.id.should eql 1
|
11
|
+
group.data.should eql data
|
12
|
+
end
|
13
|
+
|
14
|
+
it "properly reconstucts object hash" do
|
15
|
+
data = {
|
16
|
+
"key1" => "value 1",
|
17
|
+
"key2" => "value 2",
|
18
|
+
}
|
19
|
+
group = Group.new(1,data)
|
20
|
+
group.id.should eql 1
|
21
|
+
group.data.should eql data
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lights
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brady Turner
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: cucumber
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: aruba
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ! '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Client library and CLI for controlling Phillips Hue lights.
|
84
|
+
email: bradyaturner@gmail.com
|
85
|
+
executables:
|
86
|
+
- lights
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- .gitignore
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE.txt
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
95
|
+
- bin/lights
|
96
|
+
- lib/lights.rb
|
97
|
+
- lib/lights/bridge.rb
|
98
|
+
- lib/lights/bulb.rb
|
99
|
+
- lib/lights/bulbstate.rb
|
100
|
+
- lib/lights/exception.rb
|
101
|
+
- lib/lights/group.rb
|
102
|
+
- lib/lights/loggerconfig.rb
|
103
|
+
- lib/lights/sensor.rb
|
104
|
+
- lib/lights/version.rb
|
105
|
+
- lights.gemspec
|
106
|
+
- spec/bridge_spec.rb
|
107
|
+
- spec/bulb_spec.rb
|
108
|
+
- spec/bulbstate_spec.rb
|
109
|
+
- spec/features/rue.feature
|
110
|
+
- spec/features/support/setup.rb
|
111
|
+
- spec/group_spec.rb
|
112
|
+
homepage: http://rubygems.org/gems/lights
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ! '>='
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.0.6
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: lights
|
136
|
+
test_files:
|
137
|
+
- spec/bridge_spec.rb
|
138
|
+
- spec/bulb_spec.rb
|
139
|
+
- spec/bulbstate_spec.rb
|
140
|
+
- spec/features/rue.feature
|
141
|
+
- spec/features/support/setup.rb
|
142
|
+
- spec/group_spec.rb
|