Module: nintendo.switch.sun
Provides a client for the system update meta server.
class SunError(Exception)
Raised when the sun server returns an error code.
class SunClient
The sun client.
SunError
response: HTTPResponse
code: str
message: str
SunClient
def __init__(device_id: int)
Creates a new sun client. The device id can be obtained from PRODINFO.
def set_request_callback(callback: Callable) -> None
By default, requests are performed with http.request. This method lets you provide a custom callback instead.
def set_context(context: TLSContext) -> None
Changes the TLS context. By default, the server certificate is verified with Nintendo Class 2 CA - G3 and no client certificate is used.
def set_certificate(cert: TLSCertificate, key: TLSPrivateKey) -> None
Changes the client certificate of the current TLS context. The server rejects all requests without a valid client certificate.
def set_host(host: str) -> None
Changes the server to which the HTTP requests are sent. The default is: sun.hac.lp1.d4c.nintendo.net.
def set_system_version(version: int) -> None
Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, 1002 indicates system version 10.0.2. All system versions from 9.0.0 up to 22.1.0 are supported.
async def system_update_meta() -> dict
Requests the latest system update metadata.