diff --git a/app/routers/radio.py b/app/routers/radio.py index 5eaa5ea4a..cbbcac1f1 100644 --- a/app/routers/radio.py +++ b/app/routers/radio.py @@ -134,29 +134,25 @@ async def set_private_key(update: PrivateKeyUpdate) -> dict: @router.post("/advertise") -async def send_advertisement(flood: bool = True) -> dict: - """Send a radio advertisement to announce presence on the mesh. +async def send_advertisement() -> dict: + """Send a flood advertisement to announce presence on the mesh. Manual advertisement requests always send immediately, updating the last_advert_time which affects when the next periodic/startup advert can occur. - Args: - flood: Whether to flood the advertisement (default True). - Returns: status: "ok" if sent successfully """ require_connected() - # Manual requests always send (force=True), but still update last_advert_time - logger.info("Sending advertisement (flood=%s)", flood) + logger.info("Sending flood advertisement") success = await do_send_advertisement(force=True) if not success: raise HTTPException(status_code=500, detail="Failed to send advertisement") - return {"status": "ok", "flood": flood} + return {"status": "ok"} @router.post("/reboot") diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 2fb894de0..ce6d80792 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -543,7 +543,7 @@ export function App() { // Send flood advertisement handler const handleAdvertise = useCallback(async () => { try { - await api.sendAdvertisement(true); + await api.sendAdvertisement(); toast.success('Advertisement sent'); } catch (err) { console.error('Failed to send advertisement:', err); diff --git a/frontend/src/api.ts b/frontend/src/api.ts index f29b069b7..87f22b551 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -76,8 +76,8 @@ export const api = { method: 'PUT', body: JSON.stringify({ private_key: privateKey }), }), - sendAdvertisement: (flood = true) => - fetchJson<{ status: string; flood: boolean }>(`/radio/advertise?flood=${flood}`, { + sendAdvertisement: () => + fetchJson<{ status: string }>('/radio/advertise', { method: 'POST', }), rebootRadio: () =>