From 5016a1f4071ef9f0c4dedec0f80281f568e0062d Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Thu, 2 May 2024 08:49:17 +0200 Subject: [PATCH] fixing afk state --- .../src/components/grid/grid_active_broadcasts_vert.vue | 6 +----- freedata_server/server.py | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/freedata_gui/src/components/grid/grid_active_broadcasts_vert.vue b/freedata_gui/src/components/grid/grid_active_broadcasts_vert.vue index 5953c0c8..a72b91dd 100644 --- a/freedata_gui/src/components/grid/grid_active_broadcasts_vert.vue +++ b/freedata_gui/src/components/grid/grid_active_broadcasts_vert.vue @@ -22,11 +22,7 @@ function startStopBeacon() { } function setAwayFromKey(){ - if (state.away_from_key === true) { - setModemBeacon(state.beacon_state, false); - } else { - setModemBeacon(state.beacon_state, true); - } + setModemBeacon(state.beacon_state, state.away_from_key); } diff --git a/freedata_server/server.py b/freedata_server/server.py index 4fa852fc..bb76b830 100644 --- a/freedata_server/server.py +++ b/freedata_server/server.py @@ -163,8 +163,8 @@ def post_beacon(): enqueue_tx_command(command_beacon.BeaconCommand, request.json) else: app.state_manager.set('is_beacon_running', request.json['enabled']) + app.state_manager.set('is_away_from_key', request.json['away_from_key']) - return api_response(request.json) @app.route('/modem/ping_ping', methods=['POST']) def post_ping():