refactor(airtime): introduce refresh_radio_params method for dynamic modulation updates

Added a new method to the AirtimeManager class to refresh modulation parameters without clearing transmission history. Updated ConfigManager to call this method after applying live radio configurations. Enhanced tests to verify that modulation updates occur correctly during live updates.
This commit is contained in:
agessaman
2026-07-17 17:38:11 -07:00
parent b11d4972ff
commit 2432332f87
11 changed files with 236 additions and 19 deletions
+26
View File
@@ -676,3 +676,29 @@ def test_get_lbt_diagnostics_empty_range_preserves_no_data_distinction(tmp_path)
assert bucket["avg_attempts"] is None
assert out["packet_types"] == []
assert out["packet_type_buckets"] == []
def test_cleanup_old_data_accepts_companion_events_days(tmp_path):
"""engine.py forwards companion_events_days; accepting it must not break
packet retention cleanup (the pre-fix TypeError was swallowed upstream).
"""
import time
h = _make_handler(tmp_path)
old_ts = time.time() - (40 * 86400)
h.store_packet(
{
"timestamp": old_ts,
"type": 1,
"route": 2,
"length": 3,
"transmitted": False,
"packet_hash": "pkt-old",
}
)
h.cleanup_old_data(days=31, companion_events_days=14)
with h._connect() as conn:
count = conn.execute("SELECT COUNT(*) FROM packets").fetchone()[0]
assert count == 0