mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 12:07:09 +03:00
fix AP scan
This commit is contained in:
@@ -643,6 +643,8 @@ function rssiToIcon(rssi){
|
|||||||
|
|
||||||
function refreshAP(force){
|
function refreshAP(force){
|
||||||
if (!enableAPTimer && !force) return;
|
if (!enableAPTimer && !force) return;
|
||||||
|
$.getJSON( "/scan.json", async function( data ) {
|
||||||
|
await sleep(2000);
|
||||||
$.getJSON( "/ap.json", function( data ) {
|
$.getJSON( "/ap.json", function( data ) {
|
||||||
if(data.length > 0){
|
if(data.length > 0){
|
||||||
//sort by signal strength
|
//sort by signal strength
|
||||||
@@ -654,6 +656,7 @@ function refreshAP(force){
|
|||||||
refreshAPHTML(apList);
|
refreshAPHTML(apList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshAPHTML(data){
|
function refreshAPHTML(data){
|
||||||
@@ -975,3 +978,7 @@ function showMessage(message, severity, age=0) {
|
|||||||
function inRange(x, min, max) {
|
function inRange(x, min, max) {
|
||||||
return ((x-min)*(x-max) <= 0);
|
return ((x-min)*(x-max) <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user