Skip to content

Commit 8c9ee90

Browse files
committed
fix: complete working-mode state table (add Bypass + PV Charge + Bypass)
State 25 (0x19) showed "Unknown (25)". The state register is a proper enum, not a bitmask, and the previous table was missing several values. Source: the lxp-bridge Rust implementation's StatusString mapping, which is more complete than both the HA integration and the prior table. - Add 0x11 = Bypass, 0x19 = PV Charge + Bypass (the value 25 the user saw). - Align all labels with the authoritative lxp-bridge names. - Remove the incorrect bitmask fallback (0x11 = Bypass proves the register is not a simple bitmask).
1 parent 746eced commit 8c9ee90

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

‎api/__init__.py‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,20 @@ def _row_to_dict(row: tuple, columns: list[str]) -> dict[str, Any]:
9393
_STATE_LABELS = {
9494
0x00: "Standby",
9595
0x01: "Fault",
96-
0x02: "Programming",
97-
0x04: "PV on-grid",
98-
0x08: "PV charging battery",
99-
0x0C: "PV charging battery + on-grid",
100-
0x10: "Battery on-grid",
101-
0x14: "PV + battery on-grid",
102-
0x20: "AC charge (grid → battery)",
103-
0x28: "PV + AC charge",
104-
0x40: "Battery off-grid",
105-
0x80: "PV off-grid",
106-
0x88: "PV charge + off-grid",
107-
0xC0: "PV + battery off-grid",
96+
0x02: "FW Updating",
97+
0x04: "PV On-grid",
98+
0x08: "PV Charge",
99+
0x0C: "PV Charge On-grid",
100+
0x10: "Battery On-grid",
101+
0x11: "Bypass",
102+
0x14: "PV & Battery On-grid",
103+
0x19: "PV Charge + Bypass",
104+
0x20: "AC Charge",
105+
0x28: "PV & AC Charge",
106+
0x40: "Battery Off-grid",
107+
0x80: "PV Off-grid",
108+
0x88: "PV Charge Off-grid",
109+
0xC0: "PV & Battery Off-grid",
108110
}
109111

110112

0 commit comments

Comments
 (0)