working in production - not entirely validated. parallel mode working.

This commit is contained in:
2026-04-26 19:26:44 -04:00
parent f771ec2b46
commit 00ab311d92
8 changed files with 344 additions and 27 deletions

View File

@@ -336,9 +336,23 @@ QUERY_COMMANDS = {
"2": "output",
},
},
# Parallel-cluster index. PI18 spec: 0 = master, 1+ = slaves.
# Upstream powermon labels this as a 2-value flag ["Not valid", "valid"]
# which is wrong — masters end up labeled "Not valid". Fixed to expose
# the actual index. Range covers up to max_parallel_units (typ. 9).
{"description": "Parallel instance number", "reading_type": ReadingType.MESSAGE,
"response_type": ResponseType.LIST,
"options": ["Not valid", "valid"],
"response_type": ResponseType.OPTION,
"options": {
"0": "instance 0 (master)",
"1": "instance 1",
"2": "instance 2",
"3": "instance 3",
"4": "instance 4",
"5": "instance 5",
"6": "instance 6",
"7": "instance 7",
"8": "instance 8",
},
},
],
@@ -362,6 +376,7 @@ QUERY_COMMANDS = {
"03": "Battery",
"04": "Fault",
"05": "Hybrid mode(Line mode, Grid mode)",
"06": "Charge",
}
},
],
@@ -523,8 +538,10 @@ QUERY_COMMANDS = {
"command_type": CommandType.PI18_QUERY,
"result_type": ResultType.COMMA_DELIMITED,
"reading_definitions": [
# See note on the matching field in GS — same fix here.
{"description": "Parallel instance number", "reading_type": ReadingType.MESSAGE,
"response_type": ResponseType.LIST, "options": ["Not valid", "valid"]},
"response_type": ResponseType.OPTION,
"options": {str(i): f"instance {i}{' (master)' if i == 0 else ''}" for i in range(9)}},
{"description": "Parallel unit count", "reading_type": ReadingType.MESSAGE},
{"description": "Fault code", "reading_type": ReadingType.MESSAGE},
{"description": "Field 4 (raw)", "reading_type": ReadingType.MESSAGE},