lxp-packet 0.5.0 → 0.6.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: 4fc4ef9aa204639ee245d39bba281bb3ec005013a7a7d3f16f975d5e31a6eca6
4
- data.tar.gz: 9cb28af9771bf98ec9f793bf77785611337529b3514d7b8061d8ee53e234620a
3
+ metadata.gz: 8be850807f4bf009125b77a32fc9e6572575e9b82a40039cd9898a55e0e27b9c
4
+ data.tar.gz: efc7f72f2e855500f90ce223977909956c21edbe372e4c29dbe52017ee1599dc
5
5
  SHA512:
6
- metadata.gz: cb39026d5d05f414ddfae9d1087646310fb52c1d5a9b59752472eaa69046e793697165b88153e4a03bb9372c562a331e3db4284b312c0164b810b4508d6f052d
7
- data.tar.gz: 6bf3e09ff9a48c98c884f6bb45fe776cf15ca80dd6cac1445889c9a9cbb89d3b1631f9df9c18210a1c100af404e0ffbea000af695a767196a6c99ca0824ee1e4
6
+ metadata.gz: 4d06b6bd60c3fff448a629e6732b9edb7a7f1b559d1c88c61420cf4b17e1c4f48e0489d0052a72442e841085295e7ac794630d97264f55194b3546d0b1fcba7a
7
+ data.tar.gz: f9e98b57883625a567cf3d41162f3955b1bc9c311f816ce3fe40170155315e9f0f6bc6e7e2c2b9a2fcb36def46c4ea567f99c93f540803a7bc91a8de7b261e72
data/CHANGELOG.md CHANGED
@@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [Unreleased]
8
+ ## [0.6.0] - 2020-04-10
9
+
10
+ ### Added
11
+
12
+ - support `v_pv_*` keys in `ReadInput1`
13
+ - support `bat_count` key in `ReadInput3`
14
+
15
+ ## [0.5.0] - 2020-04-09
9
16
 
10
17
  ### Added
11
18
 
@@ -15,14 +15,21 @@ class LXP
15
15
 
16
16
  status: Utils.int(@data[15, 2]),
17
17
 
18
- # 17-22 all observed zeroes (v_pv, v_pv_2, v_pv_3 ?)
18
+ v_pv_1: Utils.int(@data[17, 2]) / 10.0, # V
19
+ v_pv_2: Utils.int(@data[19, 2]) / 10.0, # V
20
+ v_pv_3: Utils.int(@data[21, 2]) / 10.0, # V
19
21
 
20
22
  v_bat: Utils.int(@data[23, 2]) / 10.0, # V
21
23
  soc: @data[25], # %
22
24
  # 26 used for anything?
23
25
 
24
- # observed [0, 47] => 12032 or 0x2F00
26
+ # 27 always been 0 so far
27
+ # 28 I've seen anything from 0 to 53, changes occasionally but
28
+ # not spotted a pattern yet.
29
+ _unknown_i1_27: @data[27],
25
30
  _unknown_i1_28: @data[28],
31
+
32
+ # this might be useless if 27 and 28 are independent
26
33
  _unknown_i1_27_28: Utils.int(@data[27, 2]),
27
34
 
28
35
  p_pv: Utils.int(@data[29, 2]) +
@@ -41,7 +48,9 @@ class LXP
41
48
  p_inv: Utils.int(@data[47, 2]), # W
42
49
  p_rec: Utils.int(@data[49, 2]), # W
43
50
 
44
- _unknown_i1_51_52: Utils.int(@data[51, 2]),
51
+ # this seems to track with charge/discharge but at lower values.
52
+ # no idea what this means.
53
+ _unknown_i1_51_52: Utils.int(@data[51, 2]), # W ?
45
54
 
46
55
  pf: Utils.int(@data[53, 2]) / 1000.0, # Hz
47
56
 
@@ -32,10 +32,9 @@ class LXP
32
32
  bat_status_7: @data[39],
33
33
  bat_status_8: @data[41],
34
34
  bat_status_9: @data[43],
35
- bat_status_inv: @data[45]
35
+ bat_status_inv: @data[45],
36
36
 
37
- # 47/48 = battery count? seen a 6 but unconfirmed it changes
38
- # when battery count does.. TODO..
37
+ bat_count: Utils.int(@data[47, 2])
39
38
  }
40
39
  end
41
40
  end
data/lib/lxp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class LXP
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
data/spec/parser_spec.rb CHANGED
@@ -74,7 +74,7 @@ RSpec.describe LXP::Packet::Parser do
74
74
 
75
75
  describe '#to_h' do
76
76
  subject { packet.to_h }
77
- it { is_expected.to eq _unknown_i1_28: 47, _unknown_i1_27_28: 12_032, _unknown_i1_51_52: 227, status: 16, v_bat: 49.7, soc: 95, p_pv: 0, p_pv_1: 0, p_pv_2: 0, p_pv_3: 0, p_charge: 0, p_discharge: 633, v_ac_r: 247.6, v_ac_s: 0.1, v_ac_t: 0.0, f_ac: 50.1, p_inv: 569, p_rec: 0, pf: 1.0, v_eps_r: 247.6, v_eps_s: 281.6, v_eps_t: 2875.2, f_eps: 50.1, p_to_grid: 0, p_to_user: 0, e_pv_day: 22.1, e_pv_1_day: 22.1, e_pv_2_day: 0.0, e_pv_3_day: 0.0, e_inv_day: 4.2, e_rec_day: 7.3, e_chg_day: 8.6, e_dischg_day: 5.2, e_eps_day: 0.0, e_to_grid_day: 3.6, e_to_user_day: 0.2, v_bus_1: 375.6, v_bus_2: 299.7 }
77
+ it { is_expected.to eq _unknown_i1_27: 0, _unknown_i1_28: 47, _unknown_i1_27_28: 12_032, _unknown_i1_51_52: 227, status: 16, v_pv_1: 0.0, v_pv_2: 0.0, v_pv_3: 0.0, v_bat: 49.7, soc: 95, p_pv: 0, p_pv_1: 0, p_pv_2: 0, p_pv_3: 0, p_charge: 0, p_discharge: 633, v_ac_r: 247.6, v_ac_s: 0.1, v_ac_t: 0.0, f_ac: 50.1, p_inv: 569, p_rec: 0, pf: 1.0, v_eps_r: 247.6, v_eps_s: 281.6, v_eps_t: 2875.2, f_eps: 50.1, p_to_grid: 0, p_to_user: 0, e_pv_day: 22.1, e_pv_1_day: 22.1, e_pv_2_day: 0.0, e_pv_3_day: 0.0, e_inv_day: 4.2, e_rec_day: 7.3, e_chg_day: 8.6, e_dischg_day: 5.2, e_eps_day: 0.0, e_to_grid_day: 3.6, e_to_user_day: 0.2, v_bus_1: 375.6, v_bus_2: 299.7 }
78
78
  end
79
79
  end
80
80
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lxp-packet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Elsworth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler