mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 08:39:09 +03:00
fix modbus table for emsesp.org doc
This commit is contained in:
@@ -94,8 +94,9 @@ def print_device_entities(device_name, device_entities):
|
||||
type_suffix = split_type[1] if len(split_type) > 1 else ""
|
||||
|
||||
# Optimize type_rest extraction and int range detection
|
||||
type_rest_str = type_suffix
|
||||
type_rest_str = ""
|
||||
if "int" in type_base and "(" in type_suffix:
|
||||
print(type_base)
|
||||
try:
|
||||
# Extract inner part of parentheses
|
||||
range_inner = type_suffix[type_suffix.index("(")+1:type_suffix.index(")")]
|
||||
@@ -107,8 +108,6 @@ def print_device_entities(device_name, device_entities):
|
||||
min_value, max_value = range_inner.split("/")
|
||||
if min_value is not None and max_value is not None:
|
||||
type_rest_str = f" (>={min_value.strip()}<={max_value.strip()})"
|
||||
else:
|
||||
type_rest_str = ""
|
||||
except Exception:
|
||||
# fallback to original
|
||||
pass
|
||||
@@ -135,6 +134,9 @@ def print_device_type_devices(device_type, devices):
|
||||
|
||||
def print_header():
|
||||
"""Print the markdown document header."""
|
||||
print("---")
|
||||
print("id: Modbus-Entity-Registers")
|
||||
print("---")
|
||||
print("# Modbus Entity/Register Mapping")
|
||||
print()
|
||||
print(":::warning")
|
||||
|
||||
Reference in New Issue
Block a user