lifx_dash 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +18 -8
- data/README.md +28 -8
- data/lib/lifx_dash/version.rb +1 -1
- data/lifx_dash.gemspec +2 -3
- data/test/test_helper.rb +1 -6
- metadata +6 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ca51794c2ebf07f04ff3f7f44f811fe32a0f1d559a315b1045055984165c7d9f
|
4
|
+
data.tar.gz: e1b3d10dff9420244c6d1fe2a02ac5c5476ea8a576a4511e01acd1fb870a6abe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbbf9032c429cfa4201f41eae6b4562584e55024a95d719edb44f6eb42bcb46d0c2a6dc876ae68fae2cf1d393046f1180b229ec23b2d778357bfdc1ee798caf5
|
7
|
+
data.tar.gz: e4398d1c6f2b1bb3432c2393437bccc82cee0bd421e6ed111330c217f5f13fbb77a1a8246eda80c48c47f1b592ebb4308f0eb78e320d26116983c8e93c031727
|
data/.travis.yml
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
sudo: required
|
2
2
|
language: ruby
|
3
3
|
before_install:
|
4
|
-
- sudo apt-get install libpcap-dev -qq
|
5
|
-
- gem update --system
|
6
|
-
- gem --version
|
4
|
+
- sudo apt-get install libpcap-dev -qq
|
5
|
+
- gem update --system
|
6
|
+
- gem --version
|
7
7
|
rvm:
|
8
|
-
- 2.1.10
|
9
|
-
- 2.2.
|
10
|
-
- 2.3.
|
11
|
-
- 2.4.
|
12
|
-
-
|
8
|
+
- 2.1.10
|
9
|
+
- 2.2.9
|
10
|
+
- 2.3.6
|
11
|
+
- 2.4.3
|
12
|
+
- 2.5.0
|
13
|
+
- ruby-head
|
13
14
|
matrix:
|
14
15
|
allow_failures:
|
15
16
|
- rvm: ruby-head
|
@@ -24,3 +25,12 @@ deploy:
|
|
24
25
|
on:
|
25
26
|
tags: true
|
26
27
|
repo: matthutchinson/lifx_dash
|
28
|
+
env:
|
29
|
+
global:
|
30
|
+
- CC_TEST_REPORTER_ID=71107cb58f585bf7506e53f33238f4bd4e9aa87215ed916a5b466ecd9b493209
|
31
|
+
before_script:
|
32
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
33
|
+
- chmod +x ./cc-test-reporter
|
34
|
+
- ./cc-test-reporter before-build
|
35
|
+
after_script:
|
36
|
+
- ./cc-test-reporter after-build
|
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://img.shields.io/gem/v/lifx_dash.svg?style=flat)](http://rubygems.org/gems/lifx_dash)
|
4
4
|
[![Travis Build Status](https://travis-ci.org/matthutchinson/lifx_dash.svg?branch=master)](https://travis-ci.org/matthutchinson/lifx_dash)
|
5
|
-
[![
|
6
|
-
[![
|
7
|
-
[![Gem Dependency Status](https://gemnasium.com/matthutchinson/lifx_dash.svg)](https://gemnasium.com/matthutchinson/lifx_dash)
|
5
|
+
[![Maintainability](https://img.shields.io/codeclimate/maintainability/matthutchinson/lifx_dash.svg)](https://codeclimate.com/github/matthutchinson/lifx_dash/maintainability)
|
6
|
+
[![Test Coverage](https://img.shields.io/codeclimate/c/matthutchinson/lifx_dash.svg)](https://codeclimate.com/github/matthutchinson/lifx_dash/test_coverage)
|
7
|
+
[![Gem Dependency Status](https://gemnasium.com/badges/github.com/matthutchinson/lifx_dash.svg)](https://gemnasium.com/github.com/matthutchinson/lifx_dash)
|
8
8
|
|
9
9
|
![Amazon LIFX Dash Button](http://matthutchinson.github.io/lifx_dash/images/lifx_dash.png)
|
10
10
|
|
@@ -153,9 +153,9 @@ take a moment and check it hasn't already been raised (and possibly closed).
|
|
153
153
|
This gem uses the [PacketFu](https://rubygems.org/gems/packetfu) gem (and
|
154
154
|
[libpcap](https://sourceforge.net/projects/libpcap/) under the hood) to monitor
|
155
155
|
data packets on your network. This packet stream filters for
|
156
|
-
[DHCP](https://wiki.wireshark.org/DHCP) packets (sent from 0.0.0.0).
|
157
|
-
|
158
|
-
|
156
|
+
[DHCP](https://wiki.wireshark.org/DHCP) packets (sent from 0.0.0.0). See
|
157
|
+
[below](https://github.com/matthutchinson/lifx_dash#packet-detection)
|
158
|
+
for more details on packet detection.
|
159
159
|
|
160
160
|
When a valid packet is detected with a known source MAC address, the LIFX HTTP
|
161
161
|
API [toggle-power](https://api.developer.lifx.com/docs/toggle-power) endpoint is
|
@@ -166,6 +166,26 @@ the commands and options.
|
|
166
166
|
[MiniTest](https://rubygems.org/gems/minitest/versions/5.7.0) and
|
167
167
|
[Aruba](https://rubygems.org/gems/aruba) are used for testing.
|
168
168
|
|
169
|
+
## Packet detection
|
170
|
+
|
171
|
+
Using [WireShark](https://www.wireshark.org) to monitor the network it appears
|
172
|
+
that;
|
173
|
+
|
174
|
+
* older buttons send an ARP packet followed by one or more DHCP packets
|
175
|
+
* newer buttons send one or more DHCP packets
|
176
|
+
|
177
|
+
To detect packets on both devices it should only be necessary to look for
|
178
|
+
DHCP packets; this can be done with the following filter:
|
179
|
+
|
180
|
+
```
|
181
|
+
udp and src port 68 and dst port 67 and udp[247:4] == 0x63350103 and src host 0.0.0.0
|
182
|
+
```
|
183
|
+
|
184
|
+
However since DHCP packets appear to arrive in bursts of 2, the
|
185
|
+
[Capturer](https://github.com/matthutchinson/lifx_dash/blob/master/lib/lifx_dash/capturer.rb)
|
186
|
+
only acts on packets that have an even IP
|
187
|
+
[ID](https://tools.ietf.org/html/rfc6864) field.
|
188
|
+
|
169
189
|
## Contributing
|
170
190
|
|
171
191
|
Bug [reports](https://github.com/matthutchinson/lifx_dash/issues) and [pull
|
@@ -221,8 +241,8 @@ License](http://opensource.org/licenses/MIT).
|
|
221
241
|
## Links
|
222
242
|
|
223
243
|
* [Travis CI](http://travis-ci.org/matthutchinson/lifx_dash)
|
224
|
-
* [
|
225
|
-
* [
|
244
|
+
* [Maintainability](https://codeclimate.com/github/matthutchinson/lifx_dash/maintainability)
|
245
|
+
* [Test Coverage](https://codeclimate.com/github/matthutchinson/lifx_dash/test_coverage)
|
226
246
|
* [RDoc](http://rdoc.info/projects/matthutchinson/lifx_dash)
|
227
247
|
* [Wiki](http://wiki.github.com/matthutchinson/lifx_dash/)
|
228
248
|
* [Issues](http://github.com/matthutchinson/lifx_dash/issues)
|
data/lib/lifx_dash/version.rb
CHANGED
data/lifx_dash.gemspec
CHANGED
@@ -42,14 +42,14 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.rdoc_options << '--title' << 'lifx_dash' << '--main' << 'README.md' << '-ri'
|
43
43
|
|
44
44
|
# non-gem dependecies
|
45
|
-
spec.required_ruby_version = ">= 2.
|
45
|
+
spec.required_ruby_version = ">= 2.1"
|
46
46
|
spec.requirements << 'libpcap'
|
47
47
|
spec.requirements << 'an Amazon Dash button'
|
48
48
|
spec.requirements << 'one or more LIFX bulbs'
|
49
49
|
spec.requirements << 'root access'
|
50
50
|
|
51
51
|
# external gems
|
52
|
-
spec.add_runtime_dependency "gli", "2.
|
52
|
+
spec.add_runtime_dependency "gli", "2.17.1"
|
53
53
|
spec.add_runtime_dependency "packetfu", "1.1.13"
|
54
54
|
|
55
55
|
# dev gems
|
@@ -63,5 +63,4 @@ Gem::Specification.new do |spec|
|
|
63
63
|
spec.add_development_dependency "webmock"
|
64
64
|
spec.add_development_dependency "aruba"
|
65
65
|
spec.add_development_dependency "simplecov"
|
66
|
-
spec.add_development_dependency "coveralls"
|
67
66
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lifx_dash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Hutchinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.17.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.17.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: packetfu
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: coveralls
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
153
|
description: |2
|
168
154
|
A command line tool to listen for Amazon Dash button presses and toggle LIFX
|
169
155
|
lights ON and OFF (via the LIFX HTTP API). With options to configure: the Dash
|
@@ -228,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
214
|
requirements:
|
229
215
|
- - ">="
|
230
216
|
- !ruby/object:Gem::Version
|
231
|
-
version: 2.
|
217
|
+
version: '2.1'
|
232
218
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
219
|
requirements:
|
234
220
|
- - ">="
|
@@ -240,7 +226,7 @@ requirements:
|
|
240
226
|
- one or more LIFX bulbs
|
241
227
|
- root access
|
242
228
|
rubyforge_project:
|
243
|
-
rubygems_version: 2.
|
229
|
+
rubygems_version: 2.7.3
|
244
230
|
signing_key:
|
245
231
|
specification_version: 4
|
246
232
|
summary: Toggle LIFX lights with an Amazon Dash button
|