milight-v6 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/bin/milight +1 -1
- data/lib/milight/v6/command.rb +2 -2
- data/lib/milight/v6/socket.rb +3 -4
- data/lib/milight/v6/version.rb +1 -1
- metadata +22 -20
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.rubocop.yml +0 -25
- data/.travis.yml +0 -11
- data/Gemfile +0 -10
- data/Gemfile.lock +0 -51
- data/Rakefile +0 -10
- data/bin/console +0 -15
- data/bin/setup +0 -8
- data/milight-v6.gemspec +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 565325531747b368d29626966da14d2d2f7281ee9a4d9ed559e068207ffcf999
|
|
4
|
+
data.tar.gz: a59efd0eacc27c31b685e1daa47451ad7711d05e2ada708deeadc708ccfd23ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd823ac8b7d7488b9ba31fd78a677937887216ea8c56491242947de817e1eab1acccac1df648f21d3b89a68b7d1f423e7616452315cad8cf7193722c04341a18
|
|
7
|
+
data.tar.gz: 8da346ed906eba3f01ca395c61be17c18d3bf23793f7e3f142ceeec930679935b5052dae959c02f6ad08aaaec3c287271009fa8098d3aabf699ed932df39abc8
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Milight Wifi Bridge v6 Ruby API
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/milight-v6)
|
|
4
|
-
[](https://github.com/ppostma/milight-v6-api/actions/workflows/ci.yml)
|
|
5
|
+
[](https://github.com/ppostma/milight-v6-api/actions/workflows/github-code-scanning/codeql)
|
|
6
6
|
|
|
7
7
|
This gem provides a Ruby API for the Mi-Light Wifi Bridge using protocol version 6.
|
|
8
8
|
|
data/bin/milight
CHANGED
data/lib/milight/v6/command.rb
CHANGED
|
@@ -45,7 +45,7 @@ module Milight
|
|
|
45
45
|
@socket.send_bytes(request)
|
|
46
46
|
response, _address = @socket.receive_bytes
|
|
47
47
|
|
|
48
|
-
raise Exception, "Could not establish session with Wifi bridge." if response.nil?
|
|
48
|
+
raise Milight::V6::Exception, "Could not establish session with Wifi bridge." if response.nil?
|
|
49
49
|
|
|
50
50
|
record_last_time
|
|
51
51
|
|
|
@@ -63,7 +63,7 @@ module Milight
|
|
|
63
63
|
def calculate_checksum(bytes)
|
|
64
64
|
checksum = 0
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
(10..19).each do |i|
|
|
67
67
|
checksum += bytes[i]
|
|
68
68
|
end
|
|
69
69
|
|
data/lib/milight/v6/socket.rb
CHANGED
|
@@ -30,10 +30,9 @@ module Milight
|
|
|
30
30
|
|
|
31
31
|
[bytes, address.last]
|
|
32
32
|
rescue IO::WaitReadable
|
|
33
|
-
|
|
34
|
-
retry if ready
|
|
33
|
+
retry if socket.wait_readable(READ_TIMEOUT)
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
nil
|
|
37
36
|
end
|
|
38
37
|
|
|
39
38
|
def close
|
|
@@ -56,7 +55,7 @@ module Milight
|
|
|
56
55
|
|
|
57
56
|
def logger
|
|
58
57
|
@logger ||= begin
|
|
59
|
-
logger = Logger.new(
|
|
58
|
+
logger = Logger.new($stdout)
|
|
60
59
|
logger.level = Logger::INFO if ENV["MILIGHT_DEBUG"] != "1"
|
|
61
60
|
logger
|
|
62
61
|
end
|
data/lib/milight/v6/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: milight-v6
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Postma
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: logger
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: bundler
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
16
29
|
requirements:
|
|
17
30
|
- - "~>"
|
|
18
31
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
32
|
+
version: '4.0'
|
|
20
33
|
type: :development
|
|
21
34
|
prerelease: false
|
|
22
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
36
|
requirements:
|
|
24
37
|
- - "~>"
|
|
25
38
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
39
|
+
version: '4.0'
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
41
|
name: rake
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -61,18 +74,9 @@ executables:
|
|
|
61
74
|
extensions: []
|
|
62
75
|
extra_rdoc_files: []
|
|
63
76
|
files:
|
|
64
|
-
- ".gitignore"
|
|
65
|
-
- ".rspec"
|
|
66
|
-
- ".rubocop.yml"
|
|
67
|
-
- ".travis.yml"
|
|
68
|
-
- Gemfile
|
|
69
|
-
- Gemfile.lock
|
|
70
77
|
- LICENSE.txt
|
|
71
78
|
- README.md
|
|
72
|
-
- Rakefile
|
|
73
|
-
- bin/console
|
|
74
79
|
- bin/milight
|
|
75
|
-
- bin/setup
|
|
76
80
|
- lib/milight/v6.rb
|
|
77
81
|
- lib/milight/v6/all.rb
|
|
78
82
|
- lib/milight/v6/bridge.rb
|
|
@@ -84,12 +88,11 @@ files:
|
|
|
84
88
|
- lib/milight/v6/socket.rb
|
|
85
89
|
- lib/milight/v6/version.rb
|
|
86
90
|
- lib/milight/v6/zone.rb
|
|
87
|
-
- milight-v6.gemspec
|
|
88
91
|
homepage: https://github.com/ppostma/milight-v6-api
|
|
89
92
|
licenses:
|
|
90
93
|
- MIT
|
|
91
|
-
metadata:
|
|
92
|
-
|
|
94
|
+
metadata:
|
|
95
|
+
rubygems_mfa_required: 'true'
|
|
93
96
|
rdoc_options: []
|
|
94
97
|
require_paths:
|
|
95
98
|
- lib
|
|
@@ -97,15 +100,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
97
100
|
requirements:
|
|
98
101
|
- - ">="
|
|
99
102
|
- !ruby/object:Gem::Version
|
|
100
|
-
version:
|
|
103
|
+
version: 3.2.0
|
|
101
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
105
|
requirements:
|
|
103
106
|
- - ">="
|
|
104
107
|
- !ruby/object:Gem::Version
|
|
105
108
|
version: '0'
|
|
106
109
|
requirements: []
|
|
107
|
-
rubygems_version:
|
|
108
|
-
signing_key:
|
|
110
|
+
rubygems_version: 4.0.24
|
|
109
111
|
specification_version: 4
|
|
110
112
|
summary: Ruby API for the Milight Wifi Bridge v6
|
|
111
113
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
TargetRubyVersion: 2.4
|
|
3
|
-
DisplayCopNames: true
|
|
4
|
-
DisplayStyleGuide: true
|
|
5
|
-
Exclude:
|
|
6
|
-
- 'vendor/**/*'
|
|
7
|
-
|
|
8
|
-
Metrics/BlockLength:
|
|
9
|
-
Exclude:
|
|
10
|
-
- 'spec/**/*.rb'
|
|
11
|
-
|
|
12
|
-
Metrics/LineLength:
|
|
13
|
-
Enabled: false
|
|
14
|
-
|
|
15
|
-
Metrics/MethodLength:
|
|
16
|
-
Enabled: false
|
|
17
|
-
|
|
18
|
-
Style/ConditionalAssignment:
|
|
19
|
-
Enabled: false
|
|
20
|
-
|
|
21
|
-
Style/For:
|
|
22
|
-
Enabled: false
|
|
23
|
-
|
|
24
|
-
Style/StringLiterals:
|
|
25
|
-
Enabled: false
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
milight-v6 (0.2.0)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
ast (2.3.0)
|
|
10
|
-
diff-lcs (1.4.4)
|
|
11
|
-
parallel (1.12.1)
|
|
12
|
-
parser (2.4.0.2)
|
|
13
|
-
ast (~> 2.3)
|
|
14
|
-
powerpack (0.1.1)
|
|
15
|
-
rainbow (3.0.0)
|
|
16
|
-
rake (13.0.3)
|
|
17
|
-
rspec (3.10.0)
|
|
18
|
-
rspec-core (~> 3.10.0)
|
|
19
|
-
rspec-expectations (~> 3.10.0)
|
|
20
|
-
rspec-mocks (~> 3.10.0)
|
|
21
|
-
rspec-core (3.10.1)
|
|
22
|
-
rspec-support (~> 3.10.0)
|
|
23
|
-
rspec-expectations (3.10.1)
|
|
24
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
25
|
-
rspec-support (~> 3.10.0)
|
|
26
|
-
rspec-mocks (3.10.2)
|
|
27
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
28
|
-
rspec-support (~> 3.10.0)
|
|
29
|
-
rspec-support (3.10.2)
|
|
30
|
-
rubocop (0.52.1)
|
|
31
|
-
parallel (~> 1.10)
|
|
32
|
-
parser (>= 2.4.0.2, < 3.0)
|
|
33
|
-
powerpack (~> 0.1)
|
|
34
|
-
rainbow (>= 2.2.2, < 4.0)
|
|
35
|
-
ruby-progressbar (~> 1.7)
|
|
36
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
37
|
-
ruby-progressbar (1.9.0)
|
|
38
|
-
unicode-display_width (1.7.0)
|
|
39
|
-
|
|
40
|
-
PLATFORMS
|
|
41
|
-
ruby
|
|
42
|
-
|
|
43
|
-
DEPENDENCIES
|
|
44
|
-
bundler (~> 2.0)
|
|
45
|
-
milight-v6!
|
|
46
|
-
rake (~> 13.0)
|
|
47
|
-
rspec (~> 3.0)
|
|
48
|
-
rubocop (~> 0.52.1)
|
|
49
|
-
|
|
50
|
-
BUNDLED WITH
|
|
51
|
-
2.2.15
|
data/Rakefile
DELETED
data/bin/console
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
require "milight/v6"
|
|
6
|
-
|
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require "irb"
|
|
15
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/milight-v6.gemspec
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
lib = File.expand_path("../lib", __FILE__)
|
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require "milight/v6/version"
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name = "milight-v6"
|
|
9
|
-
spec.version = Milight::V6::VERSION
|
|
10
|
-
spec.authors = ["Peter Postma"]
|
|
11
|
-
spec.email = ["peter.postma@gmail.com"]
|
|
12
|
-
|
|
13
|
-
spec.summary = "Ruby API for the Milight Wifi Bridge v6"
|
|
14
|
-
spec.description = "Ruby API for the Milight Wifi Bridge (or Wifi iBOX controller) version 6."
|
|
15
|
-
spec.homepage = "https://github.com/ppostma/milight-v6-api"
|
|
16
|
-
spec.license = "MIT"
|
|
17
|
-
|
|
18
|
-
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
19
|
-
f.match(%r{^(test|spec|features)/})
|
|
20
|
-
end
|
|
21
|
-
spec.executables = ["milight"]
|
|
22
|
-
spec.require_paths = ["lib"]
|
|
23
|
-
|
|
24
|
-
spec.add_development_dependency "bundler", "~> 2.0"
|
|
25
|
-
spec.add_development_dependency "rake", "~> 13.0"
|
|
26
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
|
27
|
-
end
|