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 +4 -4
- data/.rubocop_todo.yml +43 -68
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +42 -38
- data/atrea_control.gemspec +1 -2
- data/lib/atrea_control/duplex/login.rb +12 -5
- data/lib/atrea_control/duplex/request.rb +2 -1
- data/lib/atrea_control/duplex/user_ctrl.rb +2 -0
- data/lib/atrea_control/duplex.rb +0 -1
- data/lib/atrea_control/logger.rb +2 -2
- data/lib/atrea_control/sensor_parser.rb +1 -1
- data/lib/atrea_control/version.rb +1 -3
- data/lib/atrea_control.rb +0 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71385fed43dd965234a78cce1a5599e2ee5f18762d9c8350d303e6233df283e7
|
4
|
+
data.tar.gz: b761d15ac374618ec497c3fc7aac31053140ad36f75948d302fbcf1723824819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
3
|
-
# on
|
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:
|
10
|
-
#
|
11
|
-
|
12
|
-
|
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
|
-
#
|
19
|
-
|
20
|
-
|
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:
|
27
|
-
# Configuration parameters:
|
28
|
-
#
|
29
|
-
|
19
|
+
# Offense count: 1
|
20
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
21
|
+
# Prefixes: when, with, without
|
22
|
+
RSpec/ContextWording:
|
30
23
|
Exclude:
|
31
|
-
- '
|
32
|
-
- 'spec/atrea_control/duplex_spec.rb'
|
24
|
+
- 'spec/support/user_ctrl.rb'
|
33
25
|
|
34
26
|
# Offense count: 1
|
35
|
-
|
36
|
-
Metrics/ClassLength:
|
27
|
+
RSpec/ExpectInHook:
|
37
28
|
Exclude:
|
38
|
-
- '
|
29
|
+
- 'spec/atrea_control/duplex/unit_spec.rb'
|
39
30
|
|
40
|
-
# Offense count:
|
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/
|
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/
|
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/
|
61
|
-
|
62
|
-
|
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:
|
80
|
-
#
|
81
|
-
|
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
|
-
- '
|
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
|
-
|
89
|
-
# Configuration parameters: EnforcedStyle.
|
90
|
-
# SupportedStyles: literals, strict
|
91
|
-
Style/MutableConstant:
|
65
|
+
Security/Eval:
|
92
66
|
Exclude:
|
93
|
-
- '
|
67
|
+
- 'lib/atrea_control/duplex/user_ctrl.rb'
|
94
68
|
|
95
69
|
# Offense count: 2
|
96
|
-
#
|
97
|
-
|
98
|
-
# URISchemes: http, https
|
99
|
-
Layout/LineLength:
|
70
|
+
# Configuration parameters: AllowedConstants.
|
71
|
+
Style/Documentation:
|
100
72
|
Exclude:
|
101
|
-
- '
|
73
|
+
- 'spec/**/*'
|
74
|
+
- 'test/**/*'
|
75
|
+
- 'lib/atrea_control.rb'
|
76
|
+
- 'lib/atrea_control/logger.rb'
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
atrea_control (2.1.
|
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.
|
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.
|
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.
|
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.
|
34
|
+
mime-types-data (3.2023.0218.1)
|
36
35
|
netrc (0.11.0)
|
37
|
-
nokogiri (1.
|
36
|
+
nokogiri (1.14.2-arm64-darwin)
|
38
37
|
racc (~> 1.4)
|
39
|
-
nokogiri (1.
|
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.
|
43
|
+
parser (3.2.1.0)
|
43
44
|
ast (~> 2.4.1)
|
44
|
-
pry (0.14.
|
45
|
+
pry (0.14.2)
|
45
46
|
coderay (~> 1.1)
|
46
47
|
method_source (~> 1.0)
|
47
|
-
public_suffix (5.0.
|
48
|
-
racc (1.6.
|
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.
|
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.
|
59
|
-
rspec-core (~> 3.
|
60
|
-
rspec-expectations (~> 3.
|
61
|
-
rspec-mocks (~> 3.
|
62
|
-
rspec-core (3.
|
63
|
-
rspec-support (~> 3.
|
64
|
-
rspec-expectations (3.
|
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.
|
67
|
-
rspec-mocks (3.
|
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.
|
70
|
-
rspec-support (3.
|
71
|
-
rubocop (1.
|
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.
|
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.
|
79
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
79
80
|
ruby-progressbar (~> 1.7)
|
80
|
-
unicode-display_width (>=
|
81
|
-
rubocop-ast (1.
|
82
|
-
parser (>= 3.
|
83
|
-
rubocop-
|
84
|
-
rubocop (~> 1.
|
85
|
-
|
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.
|
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.
|
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
|
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.
|
128
|
+
2.4.6
|
data/atrea_control.gemspec
CHANGED
@@ -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.
|
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
|
57
|
-
@driver ||= Selenium::WebDriver.
|
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
|
-
|
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
|
data/lib/atrea_control/duplex.rb
CHANGED
data/lib/atrea_control/logger.rb
CHANGED
@@ -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" =>
|
59
|
+
"preheating" => !values["preheating"].nil?,
|
60
60
|
"valid_for" => Time.now,
|
61
61
|
}
|
62
62
|
end
|
data/lib/atrea_control.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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.
|
121
|
+
rubygems_version: 3.4.6
|
122
122
|
signing_key:
|
123
123
|
specification_version: 4
|
124
124
|
summary: Get data control.atrea.eu
|