Skip to content

Commit

Permalink
Fixing issue #51 (#52)
Browse files Browse the repository at this point in the history
* Fixing issue #51

---------

Co-authored-by: Adrian Villa <[email protected]>
  • Loading branch information
AdriVillaB and adrivillab-bf authored Oct 15, 2023
1 parent 29de1c4 commit 9ecb265
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions goodwe/et.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class ET(Inverter):
# ppv1 + ppv2 + ppv3 + ppv4
Calculated("ppv",
lambda data:
read_bytes4(data, 10) +
read_bytes4(data, 18) +
read_bytes4(data, 26) +
read_bytes4(data, 34),
max(0, read_bytes4(data, 10)) +
max(0, read_bytes4(data, 18)) +
max(0, read_bytes4(data, 26)) +
max(0, read_bytes4(data, 34)),
"PV Power", "W", Kind.PV),
Byte("pv4_mode", 38, "PV4 Mode code", "", Kind.PV),
Enum("pv4_mode_label", 38, PV_MODES, "PV4 Mode", Kind.PV),
Expand Down
4 changes: 2 additions & 2 deletions tests/test_et.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def test_GW6000_EH_runtime_data(self):
self.assertSensor('vpv2', 329.6, 'V', data)
self.assertSensor('ipv2', 2.1, 'A', data)
self.assertSensor('ppv2', 691, 'W', data)
self.assertSensor('ppv', 1546, 'W', data)
self.assertSensor('ppv', 1548, 'W', data)
self.assertSensor('pv1_mode', 2, '', data)
self.assertSensor('pv1_mode_label', 'PV panels connected, producing power', '', data)
self.assertSensor('pv2_mode', 2, '', data)
Expand Down Expand Up @@ -641,7 +641,7 @@ def test_GW6000_EH_runtime_data(self):
self.assertSensor('vpv2', 329.6, 'V', data)
self.assertSensor('ipv2', 2.1, 'A', data)
self.assertSensor('ppv2', 691, 'W', data)
self.assertSensor('ppv', 1546, 'W', data)
self.assertSensor('ppv', 1548, 'W', data)
self.assertSensor('pv1_mode', 2, '', data)
self.assertSensor('pv1_mode_label', 'PV panels connected, producing power', '', data)
self.assertSensor('pv2_mode', 2, '', data)
Expand Down

0 comments on commit 9ecb265

Please sign in to comment.