Accept shared B2 VPS 0.2.1 for equipment settings and commands
This commit is contained in:
@@ -23,7 +23,7 @@ export function EquipmentSettings({device,model,hosts,telemetry,vehicles,profile
|
||||
useEffect(()=>{if(!networkPending)return;let active=true;let timer:ReturnType<typeof setTimeout>;async function poll(){try{const value=await equipmentRequest<{items:IndependentDevice[]}>('/instances');const current=value.items.find(d=>d.id===device.id);if(active&¤t)onObserved(current);}catch{/* Keep the pending operation visible; the VPS owns its bounded expiry. */}finally{if(active)timer=setTimeout(()=>void poll(),3000);}}timer=setTimeout(()=>void poll(),3000);return()=>{active=false;clearTimeout(timer);};},[device.id,networkPending,onObserved]);
|
||||
const observed=device.observed;
|
||||
const secondary=observed.configuration.servers.find(s=>s.slot===2);
|
||||
const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port);
|
||||
const fullSettings=hosts.some(h=>h.state==='paired'&&h.vehicle_ids.includes(device.vehicle_id)&&['0.1.15','0.1.16','0.1.17','0.1.18','0.1.19','0.1.20','0.1.21','0.1.22','0.1.23','0.1.24','0.1.25','0.1.26','0.1.27','0.1.28','0.1.29','0.1.30','0.1.31','0.1.32','0.1.33','0.1.34','0.1.35','0.1.36','0.1.37','0.1.38','0.1.39','0.1.40','0.1.41','0.1.42','0.1.43','0.1.44','0.1.45','0.1.46','0.2.0','0.2.1'].includes(h.status?.version??'')&&h.status?.tracker.host===secondary?.host&&h.status?.tracker.port===secondary?.port);
|
||||
const supported=observed.supported_profile_fields??Object.keys(device.settings.parameters);
|
||||
const fields=model.fields.filter(f=>supported.includes(f.key));
|
||||
const validation=policyError(settings,fields)||(selectSim&&settings.connectivity.strategy==='sim'&&!cellularSimCurrent(telemetry,settings.connectivity.sim_slot??1)?'Ожидаем свежие данные выбранной SIM перед отправкой настроек.':'');
|
||||
|
||||
@@ -64,6 +64,7 @@ def apply(hosts, identifier, revision):
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
)
|
||||
or time.time() - host["last_sync_at"] > 30
|
||||
):
|
||||
|
||||
@@ -79,6 +79,7 @@ def enqueue(hosts, identifier, request_id, preset_id):
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
}:
|
||||
raise EquipmentError("Подключите проверенную версию VPS Host с поддержкой очереди.")
|
||||
count = db.execute(
|
||||
|
||||
@@ -250,6 +250,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
)
|
||||
)
|
||||
automatic_access = None
|
||||
@@ -327,6 +328,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
}:
|
||||
raise EquipmentError("Для разрешения обеих SIM установите актуальный VPS Host.")
|
||||
if body["kind"] == "select-sim" and source.get("status", {}).get("version") not in {
|
||||
@@ -354,6 +356,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
}:
|
||||
raise EquipmentError("Для смены SIM установите актуальный VPS Host.")
|
||||
else:
|
||||
@@ -406,6 +409,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
),
|
||||
"request-position": (
|
||||
"0.1.8",
|
||||
@@ -448,6 +452,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
),
|
||||
"pulse-output": (
|
||||
"0.1.9",
|
||||
@@ -489,6 +494,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
),
|
||||
"set-output": (
|
||||
"0.1.10",
|
||||
@@ -529,6 +535,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
),
|
||||
}
|
||||
if source.get("status", {}).get("version") not in versions[command["kind"]]:
|
||||
@@ -579,6 +586,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
)
|
||||
for h in (source, target)
|
||||
):
|
||||
@@ -667,6 +675,7 @@ def start(
|
||||
"0.1.45",
|
||||
"0.1.46",
|
||||
"0.2.0",
|
||||
"0.2.1",
|
||||
}
|
||||
if durable_delivery:
|
||||
lifetime = (
|
||||
|
||||
Reference in New Issue
Block a user