MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / get_settings

Function get_settings

app/main.py:233–238  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

231
232@app.get("/api/settings", tags=["settings"])
233def get_settings(request: Request) -> dict[str, object]:
234 # LAN addresses other devices can use — loopback excluded (only works on the
235 # host). The port is whatever this request came in on.
236 port = request.url.port or 8000
237 addresses = sorted(f"http://{ip}:{port}" for ip in _local_ips() if _is_lan_ipv4(ip))
238 return {**_settings_payload(), "lan_addresses": addresses}
239
240
241@app.post("/api/settings", tags=["settings"])

Callers

nothing calls this directly

Calls 3

_local_ipsFunction · 0.85
_is_lan_ipv4Function · 0.85
_settings_payloadFunction · 0.85

Tested by

no test coverage detected