diff options
| author | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-02-11 10:02:13 +0000 |
|---|---|---|
| committer | copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> | 2026-02-11 10:02:13 +0000 |
| commit | dc65b3591a6a6fbec3f3b6af875c0907ab782047 (patch) | |
| tree | 7ffb67fb0ceb1c167bc7c060c0c900ba23580c5e /decky_client.py | |
| parent | 77ccbb27ba39db2b8de0fead54a27ce7ebda14ae (diff) | |
| download | accelerator-installer-dc65b3591a6a6fbec3f3b6af875c0907ab782047.tar.gz accelerator-installer-dc65b3591a6a6fbec3f3b6af875c0907ab782047.zip | |
Add store type configuration to set custom store mode
Co-authored-by: tranch <5999732+tranch@users.noreply.github.com>
Diffstat (limited to 'decky_client.py')
| -rw-r--r-- | decky_client.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/decky_client.py b/decky_client.py index 53f8037..5fda567 100644 --- a/decky_client.py +++ b/decky_client.py @@ -295,6 +295,21 @@ async def configure_store_url(store_url: str) -> None: token = await client.get_token() await client.connect(token) + # First, set the store type to 2 (custom) + log(f"Setting store type to custom (2)...") + await client.send(CALL, "utilities/settings/set", ["store", 2]) + + msg = await client.recv() + if msg is None: + raise RuntimeError("Connection closed by server") + + if msg.get("type") == ERROR: + log(f"Server error setting store type: {msg.get('error')}") + raise RuntimeError(f"Failed to set store type: {msg.get('error')}") + + log(f"Store type set to custom") + + # Then, set the custom store URL log(f"Setting custom store URL: {store_url}") await client.send(CALL, "utilities/settings/set", ["store_url", store_url]) @@ -319,17 +334,33 @@ async def configure_store_url(store_url: str) -> None: async def get_store_url() -> str: - """Get the configured custom store URL from Decky settings.""" + """Get the configured custom store URL and type from Decky settings.""" client = DeckyClient() try: log(f"Connecting to Decky server at {client.host}:{client.port}...") token = await client.get_token() await client.connect(token) + # Get store type + log("Getting configured store type...") + await client.send(CALL, "utilities/settings/get", ["store", 0]) + + msg = await client.recv() + if msg is None: + raise RuntimeError("Connection closed by server") + + if msg.get("type") == REPLY: + store_type = msg.get('result') + store_type_name = {0: "default", 1: "testing", 2: "custom"}.get(store_type, f"unknown ({store_type})") + log(f"Current store type: {store_type_name}") + elif msg.get("type") == ERROR: + log(f"Server error: {msg.get('error')}") + raise RuntimeError(f"Failed to get store type: {msg.get('error')}") + + # Get store URL log("Getting configured store URL...") await client.send(CALL, "utilities/settings/get", ["store_url", DEFAULT_STORE_URL]) - # Wait for reply msg = await client.recv() if msg is None: raise RuntimeError("Connection closed by server") |
