mirror of
https://github.com/rightup/pyMC_Repeater.git
synced 2026-03-28 17:43:06 +01:00
Add mesh configuration for loop detection and update API endpoint handling
This commit is contained in:
@@ -918,6 +918,10 @@ class RepeaterHandler(BaseHandler):
|
||||
"rx_delay_base": delays_config.get("rx_delay_base", 0.0),
|
||||
},
|
||||
"web": self.config.get("web", {}), # Include web configuration
|
||||
"mesh": {
|
||||
"loop_detect": self.config.get("mesh", {}).get("loop_detect", "off"),
|
||||
"global_flood_allow": self.config.get("mesh", {}).get("global_flood_allow", True),
|
||||
},
|
||||
},
|
||||
"public_key": None,
|
||||
}
|
||||
|
||||
@@ -1598,10 +1598,20 @@ class APIEndpoints:
|
||||
self.config["kiss"]["baud_rate"] = int(data["kiss_baud_rate"])
|
||||
applied.append("kiss.baud_rate")
|
||||
|
||||
# Update flood loop detection mode
|
||||
if "loop_detect" in data:
|
||||
mode = str(data["loop_detect"]).strip().lower()
|
||||
if mode not in ("off", "minimal", "moderate", "strict"):
|
||||
return self._error("loop_detect must be one of: off, minimal, moderate, strict")
|
||||
if "mesh" not in self.config:
|
||||
self.config["mesh"] = {}
|
||||
self.config["mesh"]["loop_detect"] = mode
|
||||
applied.append(f"loop_detect={mode}")
|
||||
|
||||
if not applied:
|
||||
return self._error("No valid settings provided")
|
||||
|
||||
live_sections = ["repeater", "delays", "radio"]
|
||||
live_sections = ["repeater", "delays", "radio", "mesh"]
|
||||
if "kiss" in self.config:
|
||||
live_sections.append("kiss")
|
||||
# Save to config file and live update daemon in one operation
|
||||
|
||||
Reference in New Issue
Block a user