Skip to content

Commit

Permalink
Corrected feed-in and consumed energy source and type for x3-hybrid-g4 (
Browse files Browse the repository at this point in the history
#178)

* Corrected feed-in and consumed energy source and type for x3-hybrid-g4

H3-Hybrid-G4: both feed-in and consumed energy values for `Total` and `DailyTotal` were swapped.
Both of the above were marked as `Total`.

 - Switched daily and total with each other
 - Marked reset daily as `DailyTotal`

* Tests - corrected expected values for consumed energy

 X3 Hybrid G4 inverter: corrected expected values for consumed energy daily and total  as daily was bigger than total - total as aggregate should in general be higher.

* Added 'today' postfix to daily feed-in and consumed energy

Breaking change:
 - added 'today' postfix to daily feed-in and consumed energy to adhere to the convention used for other sensors.

Attempted to correct failing coverage.
  • Loading branch information
darmach authored Nov 23, 2024
1 parent 9f5c7cf commit b2a9ac5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
name: .coverage-${{ matrix.python-version }}
path: .coverage.${{ matrix.python-version }}
if-no-files-found: error
include-hidden-files: true

coverage:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions solax/inverters/x3_hybrid_g4.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ def response_decoder(cls):
"PV Energy total": (pack_u16(80, 81), Total(Units.KWH), div10),
"EPS Energy total": (pack_u16(83, 84), Total(Units.KWH), div10),
"EPS Energy today": (85, DailyTotal(Units.KWH), div10),
"Feed-in Energy": (pack_u16(86, 87), Total(Units.KWH), div100),
"Consumed Energy": (pack_u16(88, 89), Total(Units.KWH), div100),
"Feed-in Energy total": (pack_u16(90, 91), Total(Units.KWH), div100),
"Consumed Energy total": (pack_u16(92, 93), Total(Units.KWH), div100),
"Feed-in Energy today": (pack_u16(90, 91), DailyTotal(Units.KWH), div100),
"Consumed Energy today": (pack_u16(92, 93), DailyTotal(Units.KWH), div100),
"Feed-in Energy total": (pack_u16(86, 87), Total(Units.KWH), div100),
"Consumed Energy total": (pack_u16(88, 89), Total(Units.KWH), div100),
"Battery Remaining Capacity": (103, Units.PERCENT),
"Battery Temperature": (105, Units.C, to_signed),
"Battery Remaining Energy": (
Expand Down
6 changes: 3 additions & 3 deletions tests/samples/expected_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@
"PV Energy total": 3.4,
"EPS Energy total": 0.0,
"EPS Energy today": 0.0,
"Feed-in Energy": 0.0,
"Consumed Energy": 20.09,
"Feed-in Energy today": 0.0,
"Consumed Energy today": 2.09,
"Feed-in Energy total": 0.0,
"Consumed Energy total": 2.09,
"Consumed Energy total": 20.09,
"Battery Remaining Capacity": 30.0,
"Battery Temperature": 22.0,
"Battery Remaining Energy": 3.3,
Expand Down

0 comments on commit b2a9ac5

Please sign in to comment.