quelink-mg 0.2.0 → 0.2.1

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: 23b5c621bb4f754c02531d476777765aa72129b940f5970af5e91aba7ab383b2
4
- data.tar.gz: 5bf16472b454c0fcca79673cf5ee5d52bfd7a19ef222cf670680bb5d3e8cf6e3
3
+ metadata.gz: 3ea5c2cf43ce12b5862a854e1cec5cc7149fa196f70cc6de57390d8ba4e4ef0b
4
+ data.tar.gz: ced81a168e9b4c4db172bcb205b16a1e4c981cb03ea3a565149b1524487c1c88
5
5
  SHA512:
6
- metadata.gz: 1654b91fe0307d6eb50f84b5cd557442a04bcc8b98f314b56f95e579583214ddd33166e874fab36ce486970074b3eaf8d1727a05e53a8526f58f620ae418570f
7
- data.tar.gz: d24856838b17ef5c079ddedd9817e7a7053a0f6c4bd6f7fa6b20ca7e4d89080e1504ee874ceea21a6e7fba326c7e5ff82c7c4eaa39d598fd1de0e14bf3884c43
6
+ metadata.gz: c27447f6092dcf66651a7cb7154fe85c8d491ee8945a111dad3f950ec4077f3d231425d468af84ab501ef525dad525b0a55726ec48158909c608a75a986ea4d9
7
+ data.tar.gz: 1772f49c7e43a6e2d47eafb541428f88bb1611dc0e7f5782a76d1957a57fff7067daad797d1d5ed9cb99643c250047570c5ae90b1d62ce6007fcd4ec48ba1f78
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quelink-mg (0.1.0)
4
+ quelink-mg (0.2.0)
5
5
  activesupport (~> 7.0)
6
6
 
7
7
  GEM
@@ -28,7 +28,7 @@ module QuelinkMg
28
28
  end
29
29
 
30
30
  def transform_with_timezone(value)
31
- QuelinkMg.configuration.time_zone.strptime(value, QUELINK_DATE_FORMAT)
31
+ Time.use_zone('UTC') { Time.zone.parse(value) }.in_time_zone
32
32
  end
33
33
 
34
34
  def unify_keys(hash)
@@ -28,7 +28,7 @@ module QuelinkMg
28
28
  end
29
29
 
30
30
  def transform_with_timezone(value)
31
- QuelinkMg.configuration.time_zone.strptime(value, QUELINK_DATE_FORMAT)
31
+ Time.use_zone('UTC') { Time.zone.parse(value) }.in_time_zone
32
32
  end
33
33
 
34
34
  def unify_keys(hash)
Binary file
data/quelink-mg.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'quelink-mg'
5
- s.version = '0.2.0'
5
+ s.version = '0.2.1'
6
6
  s.summary = 'Quelink devices command reader and writer'
7
7
  s.description = 'Quelink devices command reader and writer'
8
8
  s.authors = ['Stanislaw Zawadzki']
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtbsi do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtcfg do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtcmd do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtfri do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtqss do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -9,7 +9,6 @@ RSpec.describe QuelinkMg::Ack::Gtrto do
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
11
  expect(parsed_response['sub_command']).to eq 'READ'
12
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
13
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
12
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
14
13
  end
15
14
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtsri do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,7 +8,6 @@ RSpec.describe QuelinkMg::Ack::Gtudf do
8
8
  parsed_response = described_class.new(response:).hash
9
9
  expect(parsed_response['protocol_version']).to eq 'D40102'
10
10
  expect(parsed_response['unique_id']).to eq 868_239_051_011_356
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20210816045509',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20210816045509') }.in_time_zone
13
12
  end
14
13
  end
@@ -8,10 +8,8 @@ RSpec.describe QuelinkMg::Resp::Gtfri do
8
8
 
9
9
  parsed_response = described_class.new(response:).hash
10
10
  expect(parsed_response).not_to eq({})
11
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230813061231',
12
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
13
- expect(parsed_response['gps_utc_time']).to eq Time.zone.strptime('20230813061232',
14
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
11
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230813061231') }.in_time_zone
12
+ expect(parsed_response['gps_utc_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230813061232') }.in_time_zone
15
13
  expect(parsed_response['longitude']).to eq 21.012847
16
14
  expect(parsed_response['latitude']).to eq 52.200338
17
15
  expect(parsed_response['unique_id']).to eq 860_201_061_504_521
@@ -11,8 +11,7 @@ RSpec.describe QuelinkMg::Resp::Gtgsv do
11
11
  expect(parsed_response['sv_count']).to eq 11
12
12
  expect(parsed_response['sv_id_3']).to eq 5
13
13
  expect(parsed_response['sv_power_3']).to eq 22
14
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230806094936',
15
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
14
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230806094936') }.in_time_zone
16
15
  expect(parsed_response['count_number']).to eq '3E2C$'
17
16
  end
18
17
  end
@@ -18,12 +18,10 @@ RSpec.describe QuelinkMg::Resp::Gtinf do
18
18
  expect(parsed_response['charging']).to eq 1
19
19
  expect(parsed_response['led_on']).to eq 1
20
20
  expect(parsed_response['gps_on_need']).to eq 0
21
- expect(parsed_response['last_gps_fix_utc_time']).to eq Time.zone.strptime('20230811034659',
22
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
21
+ expect(parsed_response['last_gps_fix_utc_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230811034659') }.in_time_zone
23
22
  expect(parsed_response['battery_percentage']).to eq 100
24
23
  expect(parsed_response['temperature']).to eq 36.7
25
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230811114700',
26
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
24
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230811114700') }.in_time_zone
27
25
  expect(parsed_response['count_number']).to eq '00A0$'
28
26
  end
29
27
  end
@@ -17,16 +17,14 @@ RSpec.describe QuelinkMg::Resp::Gtsos do
17
17
  expect(parsed_response['altitude']).to eq 116.7
18
18
  expect(parsed_response['longitude']).to eq 114.015807
19
19
  expect(parsed_response['latitude']).to eq 22.53724
20
- expect(parsed_response['gps_utc_time']).to eq Time.zone.strptime('20230806074855',
21
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
20
+ expect(parsed_response['gps_utc_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230806074855') }.in_time_zone
22
21
  expect(parsed_response['mcc']).to eq 460
23
22
  expect(parsed_response['mnc']).to eq 0
24
23
  expect(parsed_response['lac']).to eq '27BD'
25
24
  expect(parsed_response['cel_id']).to eq '0DFC'
26
25
  expect(parsed_response['odo_mileage']).to eq ''
27
26
  expect(parsed_response['battery_percentage']).to eq 100
28
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230806074855',
29
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
27
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230806074855') }.in_time_zone
30
28
  expect(parsed_response['count_number']).to eq '00F8$'
31
29
  end
32
30
  end
@@ -15,15 +15,13 @@ RSpec.describe QuelinkMg::Resp::Gtstt do
15
15
  expect(parsed_response['altitude']).to eq 212.0
16
16
  expect(parsed_response['last_longitude']).to eq 114.016205
17
17
  expect(parsed_response['last_latitude']).to eq 22.539455
18
- expect(parsed_response['gps_utc_time']).to eq Time.zone.strptime('20230811055755',
19
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
18
+ expect(parsed_response['gps_utc_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230811055755') }.in_time_zone
20
19
  expect(parsed_response['mcc']).to eq 460
21
20
  expect(parsed_response['mnc']).to eq 1
22
21
  expect(parsed_response['lac']).to eq '253D'
23
22
  expect(parsed_response['cell_id']).to eq 'AEC3'
24
23
  expect(parsed_response['odo_mileage']).to eq 0.2
25
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230811135756',
26
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
24
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230811135756') }.in_time_zone
27
25
  expect(parsed_response['count_number']).to eq '012E$'
28
26
  end
29
27
  end
@@ -11,8 +11,7 @@ RSpec.describe QuelinkMg::Resp::Gtupc do
11
11
  expect(parsed_response['command_id']).to eq 0
12
12
  expect(parsed_response['result']).to eq 100
13
13
  expect(parsed_response['download_url']).to eq 'https://www.example.com/UPC_1.ini'
14
- expect(parsed_response['send_time']).to eq Time.zone.strptime('20230811142238',
15
- QuelinkMg::Resp::Base::QUELINK_DATE_FORMAT)
14
+ expect(parsed_response['send_time']).to eq Time.use_zone('UTC') { Time.zone.parse('20230811142238') }.in_time_zone
16
15
  expect(parsed_response['count_number']).to eq '0155$'
17
16
  end
18
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quelink-mg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislaw Zawadzki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-07 00:00:00.000000000 Z
11
+ date: 2023-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -118,6 +118,7 @@ files:
118
118
  - lib/quelink-mg/resp/gtstt.rb
119
119
  - lib/quelink-mg/resp/gtupc.rb
120
120
  - lib/quelink_mg.rb
121
+ - pkg/quelink-mg.gem
121
122
  - quelink-mg.gemspec
122
123
  - spec/quelink_mg/ack/gtbsi_spec.rb
123
124
  - spec/quelink_mg/ack/gtcfg_spec.rb