atrea_control 2.1.3 → 2.3.0

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: 80a3235f52e3b6e0015107859af95310e9015bf80b2f5c02b32e94165544633a
4
- data.tar.gz: cf9bcedac30febc4c5c09c2e3e632d98438b0688cb4ae014e22f44b3d891a9f3
3
+ metadata.gz: fd2ed6c46c2b1c7caef1d39ee4ed6e67971265273b1f985ba522876c6aaaa991
4
+ data.tar.gz: d076c8e9079314311694dc98429bad429a4b49e55456bf44699fb2ec33d7101e
5
5
  SHA512:
6
- metadata.gz: '096ace3ac304fc801a7a8d14de5df29a9110c38aef315e05a5ef265aebdc024b23a78889b547a26e3e0444a3143c0b8a320cfbd2cfed42127c84a9fb905bc5d2'
7
- data.tar.gz: 16d86c3250a24b7d14d8a29c9724e59718eba200623c185fc131371b0efc85b9ba7f015a93c1fae12b9705e58cd6d376f16984cb75d2758cc0982d86f52e366c
6
+ metadata.gz: b7fc76c48e32e116d94135d23073df680f33ad30bc6637ee596a4762b61ed57f00a8af418a8e7e6a29ffb92d2daa11aecc67e4de2353b31681670de802e06bd2
7
+ data.tar.gz: e2ff402d8e723d43c5baec15a694ee941ba3f8d5f96c31c3e30b080c03d0090209456b7e55b71085d89dd9b355840e4bf1413921e502ddef984edc4d6ad99000
@@ -6,11 +6,11 @@ jobs:
6
6
  spec:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v2
9
+ - uses: actions/checkout@v4
10
10
  - name: Set up Ruby
11
11
  uses: ruby/setup-ruby@v1
12
12
  with:
13
- ruby-version: 2.7
13
+ ruby-version: 3.2.2
14
14
  bundler-cache: true
15
15
  - uses: browser-actions/setup-firefox@latest
16
16
  - name: Run tests
data/.rubocop.yml CHANGED
@@ -5,7 +5,7 @@ require:
5
5
  AllCops:
6
6
  NewCops: enable
7
7
  SuggestExtensions: false
8
- TargetRubyVersion: 2.7
8
+ TargetRubyVersion: 3.2
9
9
 
10
10
  Style/StringLiterals:
11
11
  Enabled: true
@@ -17,3 +17,6 @@ Style/StringLiteralsInInterpolation:
17
17
 
18
18
  Style/TrailingCommaInHashLiteral:
19
19
  EnforcedStyleForMultiline: consistent_comma
20
+
21
+ Style/HashSyntax:
22
+ EnforcedShorthandSyntax: either
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
  ## [Unreleased]
2
+ ### Added
3
+ - timestamp from atrea server
4
+ ### Changed
5
+ - upgrade dependencies
6
+ - upgrade ruby version
7
+
8
+ ## [2.2.0] - 2023-10-09
9
+ ### Changed
10
+ - update dependencies
2
11
 
3
12
  ## [2.1.3] - 2023-02-04
4
13
  ### Fixed
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "pry"
9
9
  gem "rake", "~> 13.0"
10
10
  gem "rspec", "~> 3.10"
11
11
  gem "rubocop", "~> 1.7", require: false
12
- gem "rubocop-rspec", "~> 2.4", require: false
12
+ gem "rubocop-rspec", "~> 3.1", require: false
13
13
  group :test do
14
14
  gem "simplecov", require: false
15
15
  gem "webmock", "~> 3.14"
data/Gemfile.lock CHANGED
@@ -1,94 +1,99 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atrea_control (2.1.3)
5
- i18n (~> 1.8)
6
- nokogiri (~> 1.12)
4
+ atrea_control (2.3.0)
5
+ i18n (~> 1.14)
6
+ nokogiri (~> 1.15)
7
7
  rest-client (~> 2.1)
8
- selenium-webdriver (~> 4.8)
8
+ selenium-webdriver (~> 4.25.0)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.1)
14
- public_suffix (>= 2.0.2, < 6.0)
13
+ addressable (2.8.7)
14
+ public_suffix (>= 2.0.2, < 7.0)
15
15
  ast (2.4.2)
16
+ base64 (0.2.0)
17
+ bigdecimal (3.1.8)
16
18
  coderay (1.1.3)
17
- concurrent-ruby (1.2.2)
18
- crack (0.4.5)
19
+ concurrent-ruby (1.3.4)
20
+ crack (1.0.0)
21
+ bigdecimal
19
22
  rexml
20
- diff-lcs (1.5.0)
21
- docile (1.4.0)
22
- domain_name (0.5.20190701)
23
- unf (>= 0.0.5, < 1.0.0)
24
- hashdiff (1.0.1)
23
+ diff-lcs (1.5.1)
24
+ docile (1.4.1)
25
+ domain_name (0.6.20240107)
26
+ hashdiff (1.1.1)
25
27
  http-accept (1.7.0)
26
- http-cookie (1.0.5)
28
+ http-cookie (1.0.7)
27
29
  domain_name (~> 0.5)
28
- i18n (1.12.0)
30
+ i18n (1.14.6)
29
31
  concurrent-ruby (~> 1.0)
30
- json (2.6.3)
31
- method_source (1.0.0)
32
- mime-types (3.4.1)
32
+ json (2.7.2)
33
+ language_server-protocol (3.17.0.3)
34
+ logger (1.6.1)
35
+ method_source (1.1.0)
36
+ mime-types (3.6.0)
37
+ logger
33
38
  mime-types-data (~> 3.2015)
34
- mime-types-data (3.2023.0218.1)
39
+ mime-types-data (3.2024.1001)
35
40
  netrc (0.11.0)
36
- nokogiri (1.14.2-arm64-darwin)
41
+ nokogiri (1.16.7-arm64-darwin)
37
42
  racc (~> 1.4)
38
- nokogiri (1.14.2-x86_64-darwin)
43
+ nokogiri (1.16.7-x86_64-darwin)
39
44
  racc (~> 1.4)
40
- nokogiri (1.14.2-x86_64-linux)
45
+ nokogiri (1.16.7-x86_64-linux)
41
46
  racc (~> 1.4)
42
- parallel (1.22.1)
43
- parser (3.2.1.0)
47
+ parallel (1.26.3)
48
+ parser (3.3.5.0)
44
49
  ast (~> 2.4.1)
50
+ racc
45
51
  pry (0.14.2)
46
52
  coderay (~> 1.1)
47
53
  method_source (~> 1.0)
48
- public_suffix (5.0.1)
49
- racc (1.6.2)
54
+ public_suffix (6.0.1)
55
+ racc (1.8.1)
50
56
  rainbow (3.1.1)
51
- rake (13.0.6)
52
- regexp_parser (2.7.0)
57
+ rake (13.2.1)
58
+ regexp_parser (2.9.2)
53
59
  rest-client (2.1.0)
54
60
  http-accept (>= 1.7.0, < 2.0)
55
61
  http-cookie (>= 1.0.2, < 2.0)
56
62
  mime-types (>= 1.16, < 4.0)
57
63
  netrc (~> 0.8)
58
- rexml (3.2.5)
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
+ rexml (3.3.8)
65
+ rspec (3.13.0)
66
+ rspec-core (~> 3.13.0)
67
+ rspec-expectations (~> 3.13.0)
68
+ rspec-mocks (~> 3.13.0)
69
+ rspec-core (3.13.2)
70
+ rspec-support (~> 3.13.0)
71
+ rspec-expectations (3.13.3)
66
72
  diff-lcs (>= 1.2.0, < 2.0)
67
- rspec-support (~> 3.12.0)
68
- rspec-mocks (3.12.3)
73
+ rspec-support (~> 3.13.0)
74
+ rspec-mocks (3.13.2)
69
75
  diff-lcs (>= 1.2.0, < 2.0)
70
- rspec-support (~> 3.12.0)
71
- rspec-support (3.12.0)
72
- rubocop (1.47.0)
76
+ rspec-support (~> 3.13.0)
77
+ rspec-support (3.13.1)
78
+ rubocop (1.67.0)
73
79
  json (~> 2.3)
80
+ language_server-protocol (>= 3.17.0)
74
81
  parallel (~> 1.10)
75
- parser (>= 3.2.0.0)
82
+ parser (>= 3.3.0.2)
76
83
  rainbow (>= 2.2.2, < 4.0)
77
- regexp_parser (>= 1.8, < 3.0)
78
- rexml (>= 3.2.5, < 4.0)
79
- rubocop-ast (>= 1.26.0, < 2.0)
84
+ regexp_parser (>= 2.4, < 3.0)
85
+ rubocop-ast (>= 1.32.2, < 2.0)
80
86
  ruby-progressbar (~> 1.7)
81
87
  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)
88
+ rubocop-ast (1.32.3)
89
+ parser (>= 3.3.1.0)
90
+ rubocop-rspec (3.1.0)
91
+ rubocop (~> 1.61)
92
+ ruby-progressbar (1.13.0)
90
93
  rubyzip (2.3.2)
91
- selenium-webdriver (4.8.1)
94
+ selenium-webdriver (4.25.0)
95
+ base64 (~> 0.2)
96
+ logger (~> 1.4)
92
97
  rexml (~> 3.2, >= 3.2.5)
93
98
  rubyzip (>= 1.2.2, < 3.0)
94
99
  websocket (~> 1.0)
@@ -96,21 +101,18 @@ GEM
96
101
  docile (~> 1.1)
97
102
  simplecov-html (~> 0.11)
98
103
  simplecov_json_formatter (~> 0.1)
99
- simplecov-html (0.12.3)
104
+ simplecov-html (0.13.1)
100
105
  simplecov_json_formatter (0.1.4)
101
- unf (0.1.4)
102
- unf_ext
103
- unf_ext (0.0.8.2)
104
- unicode-display_width (2.4.2)
105
- webmock (3.18.1)
106
+ unicode-display_width (2.6.0)
107
+ webmock (3.24.0)
106
108
  addressable (>= 2.8.0)
107
109
  crack (>= 0.3.2)
108
110
  hashdiff (>= 0.4.0, < 2.0.0)
109
- websocket (1.2.9)
111
+ websocket (1.2.11)
110
112
 
111
113
  PLATFORMS
112
114
  arm64-darwin-22
113
- x86_64-darwin-19
115
+ arm64-darwin-23
114
116
  x86_64-darwin-20
115
117
  x86_64-linux
116
118
 
@@ -120,9 +122,9 @@ DEPENDENCIES
120
122
  rake (~> 13.0)
121
123
  rspec (~> 3.10)
122
124
  rubocop (~> 1.7)
123
- rubocop-rspec (~> 2.4)
125
+ rubocop-rspec (~> 3.1)
124
126
  simplecov
125
127
  webmock (~> 3.14)
126
128
 
127
129
  BUNDLED WITH
128
- 2.4.6
130
+ 2.5.17
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.summary = "Get data control.atrea.eu"
12
12
  spec.description = "Read data from web controller of RD5 duplex by Atrea."
13
13
  spec.homepage = "https://github.com/luk4s/atrea_control"
14
- spec.required_ruby_version = Gem::Requirement.new(">= 2.7.2")
14
+ spec.required_ruby_version = Gem::Requirement.new("~> 3.2")
15
15
 
16
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
17
 
@@ -36,8 +36,8 @@ Gem::Specification.new do |spec|
36
36
  # For more information and examples about making a new gem, checkout our
37
37
  # guide at: https://bundler.io/guides/creating_gem.html
38
38
 
39
- spec.add_dependency "i18n", "~> 1.8"
40
- spec.add_dependency "nokogiri", "~> 1.12"
39
+ spec.add_dependency "i18n", "~> 1.14"
40
+ spec.add_dependency "nokogiri", "~> 1.15"
41
41
  spec.add_dependency "rest-client", "~> 2.1"
42
- spec.add_dependency "selenium-webdriver", "~> 4.8"
42
+ spec.add_dependency "selenium-webdriver", "~> 4.25.0"
43
43
  end
@@ -13,6 +13,8 @@ module AtreaControl
13
13
  attr_reader :valid_for
14
14
  # @return [UserCtrl]
15
15
  attr_reader :user_ctrl
16
+ # @return [Time, DateTime]
17
+ attr_writer :timestamp
16
18
 
17
19
  # @param [String, Integer] user_id
18
20
  # @param [String, Integer] unit_id
@@ -37,6 +39,10 @@ module AtreaControl
37
39
  current_power || values[:current_power]
38
40
  end
39
41
 
42
+ def timestamp
43
+ @timestamp ||= values[:timestamp]
44
+ end
45
+
40
46
  def preheating?
41
47
  preheating || values[:preheating]
42
48
  end
@@ -56,7 +62,7 @@ module AtreaControl
56
62
  end
57
63
 
58
64
  def parsed
59
- parser.values(read.body)
65
+ @parsed ||= parser.values(read.body)
60
66
  end
61
67
 
62
68
  def values
@@ -75,11 +81,12 @@ module AtreaControl
75
81
  input_temperature: input_temperature,
76
82
  preheating: preheating,
77
83
  valid_for: valid_for,
84
+ timestamp: timestamp,
78
85
  }
79
86
  end
80
87
 
81
- def to_json(*args)
82
- values.to_json(*args)
88
+ def to_json(*)
89
+ values.to_json(*)
83
90
  end
84
91
 
85
92
  # Additional "parameters" for each sensors
@@ -43,6 +43,7 @@ module AtreaControl
43
43
  preheating = %w[C10200 C10202 C10215 C10217].any? do |i|
44
44
  xml.xpath("//O[@I=\"#{i}\"]/@V").last&.value == "1"
45
45
  end
46
+ parsed["timestamp"] = xml.xpath("//RD5WEB").attribute("t").to_s
46
47
  parsed["preheating"] = preheating
47
48
  parsed
48
49
  end
@@ -57,6 +58,7 @@ module AtreaControl
57
58
  "preheat_temperature" => values["preheat_temperature"].to_f / 10.0,
58
59
  "input_temperature" => values["input_temperature"].to_f / 10.0,
59
60
  "preheating" => values["preheating"],
61
+ "timestamp" => DateTime.parse(values["timestamp"]),
60
62
  "valid_for" => Time.now,
61
63
  }
62
64
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AtreaControl
4
- VERSION = "2.1.3"
4
+ VERSION = "2.3.0"
5
5
  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.3
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukáš Pokorný
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-04 00:00:00.000000000 Z
11
+ date: 2024-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: '1.14'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.8'
26
+ version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.12'
33
+ version: '1.15'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.12'
40
+ version: '1.15'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rest-client
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '4.8'
61
+ version: 4.25.0
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.8'
68
+ version: 4.25.0
69
69
  description: Read data from web controller of RD5 duplex by Atrea.
70
70
  email:
71
71
  - pokorny@luk4s.cz
@@ -78,6 +78,7 @@ files:
78
78
  - ".rspec"
79
79
  - ".rubocop.yml"
80
80
  - ".rubocop_todo.yml"
81
+ - ".ruby-version"
81
82
  - CHANGELOG.md
82
83
  - CODE_OF_CONDUCT.md
83
84
  - Gemfile
@@ -109,16 +110,16 @@ require_paths:
109
110
  - lib
110
111
  required_ruby_version: !ruby/object:Gem::Requirement
111
112
  requirements:
112
- - - ">="
113
+ - - "~>"
113
114
  - !ruby/object:Gem::Version
114
- version: 2.7.2
115
+ version: '3.2'
115
116
  required_rubygems_version: !ruby/object:Gem::Requirement
116
117
  requirements:
117
118
  - - ">="
118
119
  - !ruby/object:Gem::Version
119
120
  version: '0'
120
121
  requirements: []
121
- rubygems_version: 3.4.6
122
+ rubygems_version: 3.5.11
122
123
  signing_key:
123
124
  specification_version: 4
124
125
  summary: Get data control.atrea.eu