Improve and condense related controls

This commit is contained in:
2026-02-15 22:11:17 +00:00
parent 02bcb559bc
commit 3d5fb29068
18 changed files with 1340 additions and 209 deletions

View File

@@ -124,6 +124,22 @@ def get_service_warning(service: str) -> str:
return ""
def request_pairing(service: str, device_name: str = ""):
"""
Mark a runtime pairing request so UR clients can refresh QR/pair state.
"""
service_key = _service_key(service)
if service_key not in {"whatsapp", "instagram"}:
return
device = str(device_name or "GIA Device").strip() or "GIA Device"
update_runtime_state(
service_key,
pair_device=device,
pair_requested_at=int(time.time()),
warning="Waiting for runtime pairing QR.",
)
async def _gateway_json(method: str, url: str, payload=None):
timeout = aiohttp.ClientTimeout(total=20)
async with aiohttp.ClientSession(timeout=timeout) as session: