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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b43dde6c8b92454a3ebb63b83678cc709d959f3cd2aab090e4b52bc5e6ad4202
4
- data.tar.gz: 2565cbe4cfc87572d8eb73393f3dc5459b9e6894c8ab0f2f081ac1e42c5c2937
3
+ metadata.gz: 565325531747b368d29626966da14d2d2f7281ee9a4d9ed559e068207ffcf999
4
+ data.tar.gz: a59efd0eacc27c31b685e1daa47451ad7711d05e2ada708deeadc708ccfd23ce
5
5
  SHA512:
6
- metadata.gz: 7fbfbc54f039ea09e879c72b8b6dd450633bbf3f91ba98f9cdaa9c93f44b0da7a510b1bcd6fc37120d2b01e3ecb3d7bc9fd468d102108355abd16e6936edc99b
7
- data.tar.gz: 6d7faba2778786f8b5942837cc211e53d1fab2547a1cd7fd822431b6e993031ae4105a52968d1dea766ead271f49e904ee11d195a95634477fdcfd2580138db9
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
  [![Gem Version](https://badge.fury.io/rb/milight-v6.svg)](https://badge.fury.io/rb/milight-v6)
4
- [![Build Status](https://travis-ci.org/ppostma/milight-v6-api.svg?branch=master)](https://travis-ci.org/ppostma/milight-v6-api)
5
- [![Code Climate](https://codeclimate.com/github/ppostma/milight-v6-api/badges/gpa.svg)](https://codeclimate.com/github/ppostma/milight-v6-api)
4
+ [![CI](https://github.com/ppostma/milight-v6-api/actions/workflows/ci.yml/badge.svg)](https://github.com/ppostma/milight-v6-api/actions/workflows/ci.yml)
5
+ [![CodeQL](https://github.com/ppostma/milight-v6-api/actions/workflows/github-code-scanning/codeql/badge.svg)](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
@@ -9,7 +9,7 @@ if host == "search"
9
9
  controllers = Milight::V6::Controller.search
10
10
 
11
11
  if !controllers.empty?
12
- controllers.each { |c| puts c.to_s }
12
+ controllers.each { |controller| puts controller }
13
13
  else
14
14
  puts "No Mi-Light devices found."
15
15
  end
@@ -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
- for i in 10..19 do
66
+ (10..19).each do |i|
67
67
  checksum += bytes[i]
68
68
  end
69
69
 
@@ -30,10 +30,9 @@ module Milight
30
30
 
31
31
  [bytes, address.last]
32
32
  rescue IO::WaitReadable
33
- ready = IO.select([socket], nil, nil, READ_TIMEOUT)
34
- retry if ready
33
+ retry if socket.wait_readable(READ_TIMEOUT)
35
34
 
36
- return nil
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(STDOUT)
58
+ logger = Logger.new($stdout)
60
59
  logger.level = Logger::INFO if ENV["MILIGHT_DEBUG"] != "1"
61
60
  logger
62
61
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Milight
4
4
  module V6
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
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.2.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: 2021-04-28 00:00:00.000000000 Z
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: '2.0'
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: '2.0'
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
- post_install_message:
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: '0'
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: 3.1.4
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
@@ -1,14 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
-
13
- .ruby-version
14
- .ruby-gemset
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
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
@@ -1,11 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- cache: bundler
4
- before_install:
5
- - gem update --system
6
- rvm:
7
- - 2.4.10
8
- - 2.5.9
9
- - 2.6.7
10
- - 2.7.3
11
- - 3.0.1
data/Gemfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
- # Specify your gem's dependencies in milight-v6.gemspec
8
- gemspec
9
-
10
- gem 'rubocop', '~> 0.52.1', group: :test
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
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
- require "rubocop/rake_task"
6
-
7
- RSpec::Core::RakeTask.new(:spec)
8
- RuboCop::RakeTask.new(:rubocop)
9
-
10
- task default: %i[spec rubocop]
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
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