store compact RSSI stats and skip real-time collection

Stats.WiFi is now map[string]int8 (json "wf") holding only available
RSSI
readings; SSID and unavailable signals stay in Info.WiFi. Averages are
rounded to whole dBm.

Wi-Fi is collected only on the default 60s interval; real-time requests
reuse the last snapshot to avoid spawning osascript / dumping the BSS
cache every second.
This commit is contained in:
henrygd
2026-09-25 18:02:34 -04:00
parent 86ab0fae8b
commit 16e3fbadce
12 changed files with 86 additions and 37 deletions

View File

@@ -17,7 +17,7 @@ func TestCreateRecordsWiFiDisconnectReconnect(t *testing.T) {
{}, nil,
{"wlan0": {SSID: "new", Signal: &signal}},
} {
_, err := sys.createRecords(&system.CombinedData{Info: system.Info{WiFi: snapshot}, Stats: system.Stats{WiFi: snapshot}})
_, err := sys.createRecords(&system.CombinedData{Info: system.Info{WiFi: snapshot}})
require.NoError(t, err)
record, err := app.FindRecordById("systems", sys.Id)
require.NoError(t, err)