atrea_control 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de4b8916b41e5f8089e213a57af22064c85e4cfd21b169b4cbb8a31bf0959006
4
- data.tar.gz: e90ea88c74d8602e8add47e0284fa3313b2e11ca085e0bedba8efe010c26e9ff
3
+ metadata.gz: 71385fed43dd965234a78cce1a5599e2ee5f18762d9c8350d303e6233df283e7
4
+ data.tar.gz: b761d15ac374618ec497c3fc7aac31053140ad36f75948d302fbcf1723824819
5
5
  SHA512:
6
- metadata.gz: 17b48f07d42c1d90d3ccca8f2d4de0080d50a7528dc194ecd5ca41affcb0e15b6c1aeefed3e85930119bd5f33e7315d23bae1ff73b19086f671cad7eadc60bcc
7
- data.tar.gz: 933ded9e14e5f8a6e1e67ad1621bea251b37c2c27c7f1a6b9ca063c4f0544b5db088821651096eb0050bb51cdb9b49c6a675b603e91340ed38e6f44d6edd3c4d
6
+ metadata.gz: c2278513674f32c508b54a5e69001d94368733f90afbad3e8e808789047113d9b91f2db3c90b92c3ebfd53c0eff3777f3fcf8f236ca53d401fcbefbc803d3ca5
7
+ data.tar.gz: e7a1846465fcae8b60ec4a9ed09e24a500dd47d7c9a49093878e5ce001ba629258e44a89d932527db121ea07c8622b80878ea09ea57c83f2e2ffc4f23db88c12
data/.rubocop_todo.yml CHANGED
@@ -1,101 +1,76 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config --auto-gen-only-exclude`
3
- # on 2021-10-30 20:32:55 UTC using RuboCop version 1.22.2.
2
+ # `rubocop --auto-gen-config`
3
+ # on 2023-03-01 20:32:36 UTC using RuboCop version 1.47.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
12
- # SupportedStylesForExponentOperator: space, no_space
13
- Layout/SpaceAroundOperators:
14
- Exclude:
15
- - '_x.rb'
9
+ # Offense count: 3
10
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
11
+ Metrics/AbcSize:
12
+ Max: 34
16
13
 
17
14
  # Offense count: 2
18
- # Cop supports --auto-correct.
19
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
20
- # SupportedStyles: space, no_space, compact
21
- # SupportedStylesForEmptyBraces: space, no_space
22
- Layout/SpaceInsideHashLiteralBraces:
23
- Exclude:
24
- - '_x.rb'
15
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
16
+ Metrics/MethodLength:
17
+ Max: 21
25
18
 
26
- # Offense count: 2
27
- # Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods.
28
- # IgnoredMethods: refine
29
- Metrics/BlockLength:
19
+ # Offense count: 1
20
+ # Configuration parameters: Prefixes, AllowedPatterns.
21
+ # Prefixes: when, with, without
22
+ RSpec/ContextWording:
30
23
  Exclude:
31
- - '**/*.gemspec'
32
- - 'spec/atrea_control/duplex_spec.rb'
24
+ - 'spec/support/user_ctrl.rb'
33
25
 
34
26
  # Offense count: 1
35
- # Configuration parameters: CountComments, Max, CountAsOne.
36
- Metrics/ClassLength:
27
+ RSpec/ExpectInHook:
37
28
  Exclude:
38
- - 'lib/atrea_control/duplex.rb'
29
+ - 'spec/atrea_control/duplex/unit_spec.rb'
39
30
 
40
- # Offense count: 4
41
- # Configuration parameters: .
31
+ # Offense count: 7
32
+ # Configuration parameters: EnforcedStyle.
42
33
  # SupportedStyles: have_received, receive
43
34
  RSpec/MessageSpies:
44
- EnforcedStyle: receive
45
-
46
- # Offense count: 1
47
- # Configuration parameters: Max.
48
- RSpec/MultipleExpectations:
49
35
  Exclude:
50
- - 'spec/atrea_control/duplex_spec.rb'
36
+ - 'spec/atrea_control/duplex/login_spec.rb'
37
+ - 'spec/atrea_control/duplex/unit_spec.rb'
51
38
 
52
39
  # Offense count: 2
40
+ RSpec/MultipleExpectations:
41
+ Max: 3
42
+
43
+ # Offense count: 3
53
44
  RSpec/StubbedMock:
54
45
  Exclude:
55
- - 'spec/atrea_control/duplex_spec.rb'
46
+ - 'spec/atrea_control/duplex/login_spec.rb'
47
+ - 'spec/atrea_control/duplex/unit_spec.rb'
56
48
 
57
49
  # Offense count: 6
58
50
  RSpec/SubjectStub:
59
51
  Exclude:
60
- - 'spec/atrea_control/duplex_spec.rb'
61
-
62
- # Offense count: 1
63
- # Configuration parameters: AllowedConstants.
64
- Style/Documentation:
65
- Exclude:
66
- - 'spec/**/*'
67
- - 'test/**/*'
68
- - 'lib/atrea_control.rb'
69
-
70
- # Offense count: 2
71
- # Cop supports --auto-correct.
72
- # Configuration parameters: EnforcedStyle.
73
- # SupportedStyles: always, always_true, never
74
- Style/FrozenStringLiteralComment:
75
- Exclude:
76
- - '_x.rb'
77
- - 'spec/atrea_control/duplex_spec.rb'
52
+ - 'spec/atrea_control/duplex/login_spec.rb'
53
+ - 'spec/atrea_control/duplex/unit_spec.rb'
54
+ - 'spec/atrea_control/duplex/user_ctrl_spec.rb'
78
55
 
79
- # Offense count: 2
80
- # Cop supports --auto-correct.
81
- # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
82
- # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
83
- Style/HashSyntax:
56
+ # Offense count: 4
57
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
58
+ RSpec/VerifiedDoubles:
84
59
  Exclude:
85
- - '_x.rb'
60
+ - 'spec/atrea_control/duplex/login_spec.rb'
61
+ - 'spec/atrea_control/duplex/unit_spec.rb'
62
+ - 'spec/atrea_control/duplex/user_ctrl_spec.rb'
86
63
 
87
64
  # Offense count: 1
88
- # Cop supports --auto-correct.
89
- # Configuration parameters: EnforcedStyle.
90
- # SupportedStyles: literals, strict
91
- Style/MutableConstant:
65
+ Security/Eval:
92
66
  Exclude:
93
- - 'spec/atrea_control/duplex_spec.rb'
67
+ - 'lib/atrea_control/duplex/user_ctrl.rb'
94
68
 
95
69
  # Offense count: 2
96
- # Cop supports --auto-correct.
97
- # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
98
- # URISchemes: http, https
99
- Layout/LineLength:
70
+ # Configuration parameters: AllowedConstants.
71
+ Style/Documentation:
100
72
  Exclude:
101
- - 'lib/atrea_control/duplex.rb'
73
+ - 'spec/**/*'
74
+ - 'test/**/*'
75
+ - 'lib/atrea_control.rb'
76
+ - 'lib/atrea_control/logger.rb'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.1.2] - 2023-02-03
4
+ ### Fixed
5
+ - selenium-webdriver deprecations
6
+ - some code-style/rubocop offenses
3
7
  ## [2.1.1] - 2022-08-21
4
8
  ### Fixed
5
9
  - override "schedule program" by "temporary"
data/Gemfile.lock CHANGED
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atrea_control (2.1.0)
4
+ atrea_control (2.1.2)
5
5
  i18n (~> 1.8)
6
6
  nokogiri (~> 1.12)
7
7
  rest-client (~> 2.1)
8
- selenium-webdriver (~> 4.1)
8
+ selenium-webdriver (~> 4.8)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
@@ -13,9 +13,8 @@ GEM
13
13
  addressable (2.8.1)
14
14
  public_suffix (>= 2.0.2, < 6.0)
15
15
  ast (2.4.2)
16
- childprocess (4.1.0)
17
16
  coderay (1.1.3)
18
- concurrent-ruby (1.1.10)
17
+ concurrent-ruby (1.2.2)
19
18
  crack (0.4.5)
20
19
  rexml
21
20
  diff-lcs (1.5.0)
@@ -28,68 +27,72 @@ GEM
28
27
  domain_name (~> 0.5)
29
28
  i18n (1.12.0)
30
29
  concurrent-ruby (~> 1.0)
31
- json (2.6.2)
30
+ json (2.6.3)
32
31
  method_source (1.0.0)
33
32
  mime-types (3.4.1)
34
33
  mime-types-data (~> 3.2015)
35
- mime-types-data (3.2022.0105)
34
+ mime-types-data (3.2023.0218.1)
36
35
  netrc (0.11.0)
37
- nokogiri (1.13.8-x86_64-darwin)
36
+ nokogiri (1.14.2-arm64-darwin)
38
37
  racc (~> 1.4)
39
- nokogiri (1.13.8-x86_64-linux)
38
+ nokogiri (1.14.2-x86_64-darwin)
39
+ racc (~> 1.4)
40
+ nokogiri (1.14.2-x86_64-linux)
40
41
  racc (~> 1.4)
41
42
  parallel (1.22.1)
42
- parser (3.1.2.1)
43
+ parser (3.2.1.0)
43
44
  ast (~> 2.4.1)
44
- pry (0.14.1)
45
+ pry (0.14.2)
45
46
  coderay (~> 1.1)
46
47
  method_source (~> 1.0)
47
- public_suffix (5.0.0)
48
- racc (1.6.0)
48
+ public_suffix (5.0.1)
49
+ racc (1.6.2)
49
50
  rainbow (3.1.1)
50
51
  rake (13.0.6)
51
- regexp_parser (2.5.0)
52
+ regexp_parser (2.7.0)
52
53
  rest-client (2.1.0)
53
54
  http-accept (>= 1.7.0, < 2.0)
54
55
  http-cookie (>= 1.0.2, < 2.0)
55
56
  mime-types (>= 1.16, < 4.0)
56
57
  netrc (~> 0.8)
57
58
  rexml (3.2.5)
58
- rspec (3.11.0)
59
- rspec-core (~> 3.11.0)
60
- rspec-expectations (~> 3.11.0)
61
- rspec-mocks (~> 3.11.0)
62
- rspec-core (3.11.0)
63
- rspec-support (~> 3.11.0)
64
- rspec-expectations (3.11.0)
59
+ rspec (3.12.0)
60
+ rspec-core (~> 3.12.0)
61
+ rspec-expectations (~> 3.12.0)
62
+ rspec-mocks (~> 3.12.0)
63
+ rspec-core (3.12.1)
64
+ rspec-support (~> 3.12.0)
65
+ rspec-expectations (3.12.2)
65
66
  diff-lcs (>= 1.2.0, < 2.0)
66
- rspec-support (~> 3.11.0)
67
- rspec-mocks (3.11.1)
67
+ rspec-support (~> 3.12.0)
68
+ rspec-mocks (3.12.3)
68
69
  diff-lcs (>= 1.2.0, < 2.0)
69
- rspec-support (~> 3.11.0)
70
- rspec-support (3.11.0)
71
- rubocop (1.35.0)
70
+ rspec-support (~> 3.12.0)
71
+ rspec-support (3.12.0)
72
+ rubocop (1.47.0)
72
73
  json (~> 2.3)
73
74
  parallel (~> 1.10)
74
- parser (>= 3.1.2.1)
75
+ parser (>= 3.2.0.0)
75
76
  rainbow (>= 2.2.2, < 4.0)
76
77
  regexp_parser (>= 1.8, < 3.0)
77
78
  rexml (>= 3.2.5, < 4.0)
78
- rubocop-ast (>= 1.20.1, < 2.0)
79
+ rubocop-ast (>= 1.26.0, < 2.0)
79
80
  ruby-progressbar (~> 1.7)
80
- unicode-display_width (>= 1.4.0, < 3.0)
81
- rubocop-ast (1.21.0)
82
- parser (>= 3.1.1.0)
83
- rubocop-rspec (2.12.1)
84
- rubocop (~> 1.31)
85
- ruby-progressbar (1.11.0)
81
+ unicode-display_width (>= 2.4.0, < 3.0)
82
+ rubocop-ast (1.27.0)
83
+ parser (>= 3.2.1.0)
84
+ rubocop-capybara (2.17.1)
85
+ rubocop (~> 1.41)
86
+ rubocop-rspec (2.18.1)
87
+ rubocop (~> 1.33)
88
+ rubocop-capybara (~> 2.17)
89
+ ruby-progressbar (1.12.0)
86
90
  rubyzip (2.3.2)
87
- selenium-webdriver (4.4.0)
88
- childprocess (>= 0.5, < 5.0)
91
+ selenium-webdriver (4.8.1)
89
92
  rexml (~> 3.2, >= 3.2.5)
90
93
  rubyzip (>= 1.2.2, < 3.0)
91
94
  websocket (~> 1.0)
92
- simplecov (0.21.2)
95
+ simplecov (0.22.0)
93
96
  docile (~> 1.1)
94
97
  simplecov-html (~> 0.11)
95
98
  simplecov_json_formatter (~> 0.1)
@@ -98,7 +101,7 @@ GEM
98
101
  unf (0.1.4)
99
102
  unf_ext
100
103
  unf_ext (0.0.8.2)
101
- unicode-display_width (2.2.0)
104
+ unicode-display_width (2.4.2)
102
105
  webmock (3.18.1)
103
106
  addressable (>= 2.8.0)
104
107
  crack (>= 0.3.2)
@@ -106,6 +109,7 @@ GEM
106
109
  websocket (1.2.9)
107
110
 
108
111
  PLATFORMS
112
+ arm64-darwin-22
109
113
  x86_64-darwin-19
110
114
  x86_64-darwin-20
111
115
  x86_64-linux
@@ -121,4 +125,4 @@ DEPENDENCIES
121
125
  webmock (~> 3.14)
122
126
 
123
127
  BUNDLED WITH
124
- 2.3.11
128
+ 2.4.6
@@ -39,6 +39,5 @@ Gem::Specification.new do |spec|
39
39
  spec.add_dependency "i18n", "~> 1.8"
40
40
  spec.add_dependency "nokogiri", "~> 1.12"
41
41
  spec.add_dependency "rest-client", "~> 2.1"
42
- spec.add_dependency "selenium-webdriver", "~> 4.1"
43
-
42
+ spec.add_dependency "selenium-webdriver", "~> 4.8"
44
43
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "digest"
2
4
  require "rest-client"
3
5
  require "selenium-webdriver"
@@ -6,7 +8,6 @@ module AtreaControl
6
8
  module Duplex
7
9
  # Process login into RD5 with selenium to get `sid` ( auth_token ) for direct API communication
8
10
  class Login
9
-
10
11
  include AtreaControl::Logger
11
12
 
12
13
  # @return [Hash] - user_id, unit_id, sid
@@ -52,9 +53,12 @@ module AtreaControl
52
53
  def driver
53
54
  return @driver if defined?(@driver)
54
55
 
56
+ # options = Selenium::WebDriver::Firefox::Options.new
57
+ # options.headless! unless ENV["NO_HEADLESS"]
58
+ # @driver ||= Selenium::WebDriver.for :firefox, capabilities: [options]
55
59
  options = Selenium::WebDriver::Firefox::Options.new
56
- options.headless! unless ENV["NO_HEADLESS"]
57
- @driver ||= Selenium::WebDriver.for :firefox, capabilities: [options]
60
+ options.add_argument "-headless" unless ENV["NO_HEADLESS"]
61
+ @driver ||= Selenium::WebDriver::Firefox::Driver.new options: options
58
62
  end
59
63
 
60
64
  # Login into control
@@ -95,7 +99,11 @@ module AtreaControl
95
99
 
96
100
  # quit selenium browser
97
101
  def close
98
- driver.quit rescue nil
102
+ begin
103
+ driver.quit
104
+ rescue StandardError
105
+ nil
106
+ end
99
107
  logger.debug "driver closed & destroyed"
100
108
  ensure
101
109
  remove_instance_variable :@driver
@@ -114,7 +122,6 @@ module AtreaControl
114
122
  File.write("/tmp/failed_login-#{@login}.html", driver.page_source)
115
123
  raise AtreaControl::Error, "unable to login"
116
124
  end
117
-
118
125
  end
119
126
  end
120
127
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rest-client"
2
4
 
3
5
  module AtreaControl
@@ -24,7 +26,6 @@ module AtreaControl
24
26
  def call(params)
25
27
  RestClient.get "#{AtreaControl::Duplex::CONTROL_URI}/comm/sw/unit.php", params: @params.merge(params)
26
28
  end
27
-
28
29
  end
29
30
  end
30
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "nokogiri"
2
4
 
3
5
  module AtreaControl
@@ -10,6 +10,5 @@ module AtreaControl
10
10
  autoload :Request, "atrea_control/duplex/request"
11
11
  autoload :Unit, "atrea_control/duplex/unit"
12
12
  autoload :UserCtrl, "atrea_control/duplex/user_ctrl"
13
-
14
13
  end
15
14
  end
@@ -1,11 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "logger"
2
4
 
3
5
  module AtreaControl
4
6
  module Logger
5
-
6
7
  def logger
7
8
  @logger ||= ::Logger.new($stdout)
8
9
  end
9
-
10
10
  end
11
11
  end
@@ -56,7 +56,7 @@ module AtreaControl
56
56
  "outdoor_temperature" => values["outdoor_temperature"].to_f / 10.0,
57
57
  "preheat_temperature" => values["preheat_temperature"].to_f / 10.0,
58
58
  "input_temperature" => values["input_temperature"].to_f / 10.0,
59
- "preheating" => !!values["preheating"],
59
+ "preheating" => !values["preheating"].nil?,
60
60
  "valid_for" => Time.now,
61
61
  }
62
62
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AtreaControl
4
-
5
- VERSION = "2.1.1"
6
-
4
+ VERSION = "2.1.2"
7
5
  end
data/lib/atrea_control.rb CHANGED
@@ -13,5 +13,4 @@ module AtreaControl
13
13
 
14
14
  I18n.load_path.concat Dir["#{File.expand_path("../config/locales", __dir__)}/*.yml"]
15
15
  I18n.default_locale = :cs
16
-
17
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atrea_control
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukáš Pokorný
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-21 00:00:00.000000000 Z
11
+ date: 2023-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '4.1'
61
+ version: '4.8'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '4.1'
68
+ version: '4.8'
69
69
  description: Read data from web controller of RD5 duplex by Atrea.
70
70
  email:
71
71
  - pokorny@luk4s.cz
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.3.11
121
+ rubygems_version: 3.4.6
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Get data control.atrea.eu