diff --git a/mothership/cmd/mothership/main.go b/mothership/cmd/mothership/main.go index 2ae59e6..5b23927 100644 --- a/mothership/cmd/mothership/main.go +++ b/mothership/cmd/mothership/main.go @@ -652,6 +652,11 @@ func main() { dashboardHub.SetIngestionState(ingestSrv) + // Wire BLE state to dashboard for ble_scan broadcasts (5s interval) + if bleRegistry != nil { + dashboardHub.SetBLEState(bleRegistry) + } + // Wire zone state to dashboard for occupancy snapshots if zonesMgr != nil { dashboardHub.SetZoneState(&zoneStateAdapter{mgr: zonesMgr}) @@ -674,9 +679,10 @@ func main() { }() } - // Wire ingestion → dashboard for CSI and motion broadcasts + // Wire ingestion → dashboard for CSI, motion, and event broadcasts ingestSrv.SetDashboardBroadcaster(dashboardHub) ingestSrv.SetMotionBroadcaster(dashboardHub) + ingestSrv.SetEventBroadcaster(dashboardHub) // Phase 6: Wire BLE messages to registry and identity matcher ingestSrv.SetBLEHandler(func(nodeMAC string, devices []ingestion.BLEDevice) { diff --git a/mothership/internal/ble/registry.go b/mothership/internal/ble/registry.go index 992cc9a..1046403 100644 --- a/mothership/internal/ble/registry.go +++ b/mothership/internal/ble/registry.go @@ -1373,10 +1373,13 @@ func (r *Registry) GetCurrentDevices() []map[string]interface{} { result := make([]map[string]interface{}, len(devices)) for i, d := range devices { result[i] = map[string]interface{}{ - "mac": d.Addr, - "name": d.Name, - "label": d.Label, - "manufacturer": d.Manufacturer, + "mac": d.Addr, + "name": d.Name, + "label": d.Label, + "rssi": d.RSSIAvg, + "last_seen": d.LastSeenAt.UnixMilli(), + "blob_id": nil, + "manufacturer": d.Manufacturer, "device_type": d.DeviceType, "device_name": d.DeviceName, "mfr_id": d.MfrID,