atrea_control 2.1.0 → 2.1.2

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: 47dfda0eb6906708f68c4d43dae4a9ed7249492e32150fb40e244302158a2f10
4
- data.tar.gz: dd16ffa80d5b61380a14814690058165d3fc8b2e8ab79f3ca17d4ccf8f218e7e
3
+ metadata.gz: 71385fed43dd965234a78cce1a5599e2ee5f18762d9c8350d303e6233df283e7
4
+ data.tar.gz: b761d15ac374618ec497c3fc7aac31053140ad36f75948d302fbcf1723824819
5
5
  SHA512:
6
- metadata.gz: 109c78b115fc8652a5f2b113c5ac14972ae8e7a469ca4453365edf01a3c8898f3e25c78bf39a7da02947440868ddcdcfa8f9a2b5a3f0be997ece7f6bc3598319
7
- data.tar.gz: 696a0c42c1fe2b4881247753f318290e52450299cebeab73c2faffee8e7b151f5f4000e8896fe42ef227184ae881a0a324306f02d49d1aba416061a3620f8e0b
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,15 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [2.1.2] - 2023-02-03
4
+ ### Fixed
5
+ - selenium-webdriver deprecations
6
+ - some code-style/rubocop offenses
7
+ ## [2.1.1] - 2022-08-21
8
+ ### Fixed
9
+ - override "schedule program" by "temporary"
10
+ ### Changed
11
+ - dependencies update
12
+
3
13
  ## [2.1.0] - 2022-02-28
4
14
  ### Added
5
15
  - preheating is ON ?
data/Gemfile.lock CHANGED
@@ -1,21 +1,20 @@
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/
12
12
  specs:
13
- addressable (2.8.0)
14
- public_suffix (>= 2.0.2, < 5.0)
13
+ addressable (2.8.1)
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.9)
17
+ concurrent-ruby (1.2.2)
19
18
  crack (0.4.5)
20
19
  rexml
21
20
  diff-lcs (1.5.0)
@@ -24,69 +23,76 @@ GEM
24
23
  unf (>= 0.0.5, < 1.0.0)
25
24
  hashdiff (1.0.1)
26
25
  http-accept (1.7.0)
27
- http-cookie (1.0.4)
26
+ http-cookie (1.0.5)
28
27
  domain_name (~> 0.5)
29
- i18n (1.10.0)
28
+ i18n (1.12.0)
30
29
  concurrent-ruby (~> 1.0)
30
+ json (2.6.3)
31
31
  method_source (1.0.0)
32
32
  mime-types (3.4.1)
33
33
  mime-types-data (~> 3.2015)
34
- mime-types-data (3.2022.0105)
34
+ mime-types-data (3.2023.0218.1)
35
35
  netrc (0.11.0)
36
- nokogiri (1.13.3-x86_64-darwin)
36
+ nokogiri (1.14.2-arm64-darwin)
37
37
  racc (~> 1.4)
38
- nokogiri (1.13.3-x86_64-linux)
38
+ nokogiri (1.14.2-x86_64-darwin)
39
39
  racc (~> 1.4)
40
- parallel (1.21.0)
41
- parser (3.1.1.0)
40
+ nokogiri (1.14.2-x86_64-linux)
41
+ racc (~> 1.4)
42
+ parallel (1.22.1)
43
+ parser (3.2.1.0)
42
44
  ast (~> 2.4.1)
43
- pry (0.14.1)
45
+ pry (0.14.2)
44
46
  coderay (~> 1.1)
45
47
  method_source (~> 1.0)
46
- public_suffix (4.0.6)
47
- racc (1.6.0)
48
+ public_suffix (5.0.1)
49
+ racc (1.6.2)
48
50
  rainbow (3.1.1)
49
51
  rake (13.0.6)
50
- regexp_parser (2.2.1)
52
+ regexp_parser (2.7.0)
51
53
  rest-client (2.1.0)
52
54
  http-accept (>= 1.7.0, < 2.0)
53
55
  http-cookie (>= 1.0.2, < 2.0)
54
56
  mime-types (>= 1.16, < 4.0)
55
57
  netrc (~> 0.8)
56
58
  rexml (3.2.5)
57
- rspec (3.11.0)
58
- rspec-core (~> 3.11.0)
59
- rspec-expectations (~> 3.11.0)
60
- rspec-mocks (~> 3.11.0)
61
- rspec-core (3.11.0)
62
- rspec-support (~> 3.11.0)
63
- 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)
64
66
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.11.0)
66
- rspec-mocks (3.11.0)
67
+ rspec-support (~> 3.12.0)
68
+ rspec-mocks (3.12.3)
67
69
  diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.11.0)
69
- rspec-support (3.11.0)
70
- rubocop (1.25.1)
70
+ rspec-support (~> 3.12.0)
71
+ rspec-support (3.12.0)
72
+ rubocop (1.47.0)
73
+ json (~> 2.3)
71
74
  parallel (~> 1.10)
72
- parser (>= 3.1.0.0)
75
+ parser (>= 3.2.0.0)
73
76
  rainbow (>= 2.2.2, < 4.0)
74
77
  regexp_parser (>= 1.8, < 3.0)
75
- rexml
76
- rubocop-ast (>= 1.15.1, < 2.0)
78
+ rexml (>= 3.2.5, < 4.0)
79
+ rubocop-ast (>= 1.26.0, < 2.0)
77
80
  ruby-progressbar (~> 1.7)
78
- unicode-display_width (>= 1.4.0, < 3.0)
79
- rubocop-ast (1.16.0)
80
- parser (>= 3.1.1.0)
81
- rubocop-rspec (2.9.0)
82
- rubocop (~> 1.19)
83
- 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)
84
90
  rubyzip (2.3.2)
85
- selenium-webdriver (4.1.0)
86
- childprocess (>= 0.5, < 5.0)
91
+ selenium-webdriver (4.8.1)
87
92
  rexml (~> 3.2, >= 3.2.5)
88
- rubyzip (>= 1.2.2)
89
- simplecov (0.21.2)
93
+ rubyzip (>= 1.2.2, < 3.0)
94
+ websocket (~> 1.0)
95
+ simplecov (0.22.0)
90
96
  docile (~> 1.1)
91
97
  simplecov-html (~> 0.11)
92
98
  simplecov_json_formatter (~> 0.1)
@@ -94,15 +100,18 @@ GEM
94
100
  simplecov_json_formatter (0.1.4)
95
101
  unf (0.1.4)
96
102
  unf_ext
97
- unf_ext (0.0.8)
98
- unicode-display_width (2.1.0)
99
- webmock (3.14.0)
103
+ unf_ext (0.0.8.2)
104
+ unicode-display_width (2.4.2)
105
+ webmock (3.18.1)
100
106
  addressable (>= 2.8.0)
101
107
  crack (>= 0.3.2)
102
108
  hashdiff (>= 0.4.0, < 2.0.0)
109
+ websocket (1.2.9)
103
110
 
104
111
  PLATFORMS
112
+ arm64-darwin-22
105
113
  x86_64-darwin-19
114
+ x86_64-darwin-20
106
115
  x86_64-linux
107
116
 
108
117
  DEPENDENCIES
@@ -116,4 +125,4 @@ DEPENDENCIES
116
125
  webmock (~> 3.14)
117
126
 
118
127
  BUNDLED WITH
119
- 2.2.17
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
@@ -49,8 +49,10 @@ module AtreaControl
49
49
  end
50
50
 
51
51
  def power=(value)
52
- v = parser.input(@user_ctrl.sensors["power_input"], value.to_s)
53
- write(v)
52
+ v = [parser.input(@user_ctrl.sensors["power_input"], value.to_s)]
53
+ # overtake schedule control
54
+ v << "H1070000002" if value.to_i.positive?
55
+ write(*v)
54
56
  end
55
57
 
56
58
  def parsed
@@ -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.0"
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.0
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-02-28 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.1.4
121
+ rubygems_version: 3.4.6
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Get data control.atrea.eu