Improve and condense related controls
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user