mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-05-21 15:14:45 +02:00
fix: Add get_all_traceroutes and get_all_channels compat methods
Completes backwards compatibility layer for mesh_health.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c756727cad
commit
800e4d9e7e
1 changed files with 41 additions and 0 deletions
|
|
@ -2097,6 +2097,47 @@ class MeshDataStore:
|
||||||
}
|
}
|
||||||
result.append(edge_dict)
|
result.append(edge_dict)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def get_all_traceroutes(self) -> list[dict]:
|
||||||
|
"""Get all traceroutes as list of dicts (backwards compatibility).
|
||||||
|
|
||||||
|
Returns traceroutes in the format expected by mesh_health.py.
|
||||||
|
"""
|
||||||
|
result = []
|
||||||
|
for tr in self._traceroutes:
|
||||||
|
tr_dict = {
|
||||||
|
"from_node": tr.from_node,
|
||||||
|
"to_node": tr.to_node,
|
||||||
|
"route": tr.route,
|
||||||
|
"route_back": tr.route_back,
|
||||||
|
"snr_towards": tr.snr_towards,
|
||||||
|
"snr_back": tr.snr_back,
|
||||||
|
"timestamp": tr.timestamp,
|
||||||
|
"request_id": tr.request_id,
|
||||||
|
}
|
||||||
|
result.append(tr_dict)
|
||||||
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def get_all_channels(self) -> list[dict]:
|
||||||
|
"""Get all channels as list of dicts (backwards compatibility).
|
||||||
|
|
||||||
|
Returns channels in the format expected by mesh_health.py.
|
||||||
|
"""
|
||||||
|
result = []
|
||||||
|
for ch in self._channels:
|
||||||
|
ch_dict = {
|
||||||
|
"channel_id": ch.channel_id,
|
||||||
|
"name": ch.name,
|
||||||
|
"role": ch.role,
|
||||||
|
"role_name": ch.role_name,
|
||||||
|
"uplink_enabled": ch.uplink_enabled,
|
||||||
|
"downlink_enabled": ch.downlink_enabled,
|
||||||
|
"position_precision": ch.position_precision,
|
||||||
|
}
|
||||||
|
result.append(ch_dict)
|
||||||
|
return result
|
||||||
|
|
||||||
def close(self) -> None:
|
def close(self) -> None:
|
||||||
"""Close database connection."""
|
"""Close database connection."""
|
||||||
if self._db:
|
if self._db:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue