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 ""
|
type_suffix = split_type[1] if len(split_type) > 1 else ""
|
||||||
|
|
||||||
# Optimize type_rest extraction and int range detection
|
# 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:
|
if "int" in type_base and "(" in type_suffix:
|
||||||
|
print(type_base)
|
||||||
try:
|
try:
|
||||||
# Extract inner part of parentheses
|
# Extract inner part of parentheses
|
||||||
range_inner = type_suffix[type_suffix.index("(")+1:type_suffix.index(")")]
|
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("/")
|
min_value, max_value = range_inner.split("/")
|
||||||
if min_value is not None and max_value is not None:
|
if min_value is not None and max_value is not None:
|
||||||
type_rest_str = f" (>={min_value.strip()}<={max_value.strip()})"
|
type_rest_str = f" (>={min_value.strip()}<={max_value.strip()})"
|
||||||
else:
|
|
||||||
type_rest_str = ""
|
|
||||||
except Exception:
|
except Exception:
|
||||||
# fallback to original
|
# fallback to original
|
||||||
pass
|
pass
|
||||||
@@ -135,6 +134,9 @@ def print_device_type_devices(device_type, devices):
|
|||||||
|
|
||||||
def print_header():
|
def print_header():
|
||||||
"""Print the markdown document header."""
|
"""Print the markdown document header."""
|
||||||
|
print("---")
|
||||||
|
print("id: Modbus-Entity-Registers")
|
||||||
|
print("---")
|
||||||
print("# Modbus Entity/Register Mapping")
|
print("# Modbus Entity/Register Mapping")
|
||||||
print()
|
print()
|
||||||
print(":::warning")
|
print(":::warning")
|
||||||
|
|||||||
Reference in New Issue
Block a user