Correct the ups_alarm field spelling

The upstream River 3 schema spells field 355 `ups_alram`. Use `ups_alarm` in the decoder, the generated schema, and the field reference. The schema generator now applies a rename map, so a regenerated schema keeps the corrected name.
This commit is contained in:
tim
2026-10-10 09:03:32 +02:00
parent 5fa6000c70
commit 452a3bc207
5 changed files with 14 additions and 4 deletions
+3 -1
View File
@@ -18,6 +18,8 @@ SCALARS = {
"bool", "bytes", "string", "float", "double", "int32", "int64", "uint32",
"uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64",
}
# Corrected upstream field spellings. Field numbers, not names, identify wire data.
RENAMES = {"ups_alram": "ups_alarm"}
def api(path):
@@ -68,7 +70,7 @@ def parse_schema(text):
if not match:
raise ValueError(f"Unsupported field declaration in {name}: {statement}")
cardinality, data_type, field_name, number = match.groups()
value = (field_name, data_type, cardinality == "repeated")
value = (RENAMES.get(field_name, field_name), data_type, cardinality == "repeated")
else:
match = re.fullmatch(r"(\w+)\s*=\s*(-?\d+)", statement)
if not match: