Skip to content

Commit

Permalink
Add Support for X1-Hybiyd-G3 (Solax X1 Hybrid 2xMPPT) (#27)
Browse files Browse the repository at this point in the history
* Add Support for X1-Hybiyd-G3 (Solax X1 Hybrid 2xMPPT)

closes #26

* cleanup
  • Loading branch information
squishykid authored Nov 23, 2020
1 parent b774fc2 commit ce0c360
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion solax/inverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ class X1(InverterPost):
[vol.Coerce(float)],
vol.Any(
vol.Length(min=102, max=102),
vol.Length(min=103, max=103)),
vol.Length(min=103, max=103),
vol.Length(min=107, max=107),
),
)
),
vol.Required('Information'): vol.Schema(
Expand Down
34 changes: 34 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,32 @@
1, 1.10, 1.02, 1.09, 1.02]
}

X1_HYBRID_G3_2X_MPPT_RESPONSE = {
"type": "X1-Hybiyd-G3",
"SN": "XXXXXXXXXX",
"ver": "2.033.20",
"Data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
100, 101, 102, 103, 104, 105, 106],
"Information": [3.000, 3, "X1-Hybiyd-G3", "YYYYYYYYYYYYYY",
1, 3.11, 0.00, 3.13, 1.05],
"battery": {
"brand": "0",
"masterVer": "0.00",
"slaveNum": "0",
"slaveVer": [0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
"slaveType": [0, 0, 0, 0, 0, 0, 0, 0]
}
}

X3_HYBRID_G3_RESPONSE = {
"type": "X3-Hybiyd-G3",
"SN": "XXXXXXX",
Expand Down Expand Up @@ -300,6 +326,14 @@ def simple_http_fixture(httpserver):
inverter=inverter.X1,
values=X1_VALUES,
),
InverterUnderTest(
uri="/",
method='POST',
query_string='optType=ReadRealTimeData',
response=X1_HYBRID_G3_2X_MPPT_RESPONSE,
inverter=inverter.X1,
values=X1_VALUES,
)
]


Expand Down

0 comments on commit ce0c360

Please sign in to comment.