Add BLE alerter configuration to operator_setup.sh (mode, devices, timeout, Matrix creds)
This commit is contained in:
Executable → Regular
+39
@@ -405,6 +405,44 @@ if [[ "$enable_alerter" =~ ^[yY]$ ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# BLE Presence Detection
|
||||
step "BLE Presence Detection"
|
||||
prompt_default enable_ble "Enable BLE presence alerter? (y/n)" "n"
|
||||
BB_BLE_MODE="open"
|
||||
BB_BLE_DEVICES=""
|
||||
BB_BLE_TIMEOUT="60"
|
||||
BB_BLE_MATRIX_HS=""
|
||||
BB_BLE_MATRIX_ROOM=""
|
||||
BB_BLE_MATRIX_TOKEN=""
|
||||
if [[ "$enable_ble" =~ ^[yY]$ ]]; then
|
||||
echo " [1] Open mode (alert on any named device)"
|
||||
echo " [2] Known mode (alert only for specific devices)"
|
||||
prompt_default ble_mode "BLE mode (1-2)" "1"
|
||||
if [[ "$ble_mode" == "1" ]]; then
|
||||
BB_BLE_MODE="open"
|
||||
elif [[ "$ble_mode" == "2" ]]; then
|
||||
BB_BLE_MODE="known"
|
||||
echo -e " ${YELLOW}Enter device names one per line (empty line to finish)${NC}"
|
||||
_DEVICE_LIST=""
|
||||
while true; do
|
||||
echo -n -e " ${CYAN}Device name:${NC} "
|
||||
read -r _DEV_NAME
|
||||
[[ -z "$_DEV_NAME" ]] && break
|
||||
_DEVICE_LIST="${_DEVICE_LIST}${_DEVICE_LIST:+,}${_DEV_NAME}"
|
||||
done
|
||||
BB_BLE_DEVICES="$_DEVICE_LIST"
|
||||
fi
|
||||
prompt_default ble_timeout "Departure timeout (seconds)" "60"
|
||||
BB_BLE_TIMEOUT="$ble_timeout"
|
||||
echo -e " ${YELLOW}Use same Matrix credentials as network alerter${NC}"
|
||||
prompt_default ble_matrix_hs "Homeserver URL" "${BB_ALERTER_MATRIX_HS:-}"
|
||||
prompt_default ble_matrix_room "Room ID" "${BB_ALERTER_MATRIX_ROOM:-}"
|
||||
prompt_default ble_matrix_token "Bot access token" "${BB_ALERTER_MATRIX_TOKEN:-}"
|
||||
BB_BLE_MATRIX_HS="$ble_matrix_hs"
|
||||
BB_BLE_MATRIX_ROOM="$ble_matrix_room"
|
||||
BB_BLE_MATRIX_TOKEN="$ble_matrix_token"
|
||||
fi
|
||||
|
||||
# ══════════════════════════════════════════════════════════════════════════════
|
||||
# 5. CONFIG SUMMARY
|
||||
# ══════════════════════════════════════════════════════════════════════════════
|
||||
@@ -429,6 +467,7 @@ else
|
||||
echo -e "VPN: ${BOLD}${BB_VPN}${NC}"
|
||||
fi
|
||||
echo -e "Alerter: ${BOLD}$([ -n "$BB_ALERTER_TYPE" ] && echo "$BB_ALERTER_TYPE" || echo "disabled")${NC}"
|
||||
echo -e "BLE Alerter: ${BOLD}$([ -n "$BB_BLE_MODE" ] && echo "$BB_BLE_MODE" || echo "disabled")${NC}"
|
||||
echo ""
|
||||
|
||||
echo -n -e "${CYAN}Proceed with flashing and configuration? (y/n):${NC} "
|
||||
|
||||
Reference in New Issue
Block a user