This commit is contained in:
2026-08-15 16:46:58 +12:00
commit a4aa721a59
16 changed files with 508 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
from .env_key import SunshineEnvKey as EnvKey
from .enums import SunshineAudioConfig
from .structs import SunshineAudioConfig, SunshineEnvironmentVariables, SunshineClientSpecs, SunshineClientInfo, SunshineClientOptions
from os import environ
def load_env_variables() -> SunshineEnvironmentVariables:
def ld_str(var: EnvKey): return environ.get(var.requested_key, var.default)
def ld_int(var: EnvKey): return int(ld_str(var))
def ld_bool(var: EnvKey): return ld_str(var).lower() == "true"
return SunshineEnvironmentVariables(
SunshineClientInfo(
app_id = ld_str(EnvKey.APP_ID),
app_name = ld_str(EnvKey.APP_NAME)
),
SunshineClientSpecs(
width = ld_int(EnvKey.WIDTH),
height = ld_int(EnvKey.HEIGHT),
fps = ld_int(EnvKey.FPS),
hdr = ld_bool(EnvKey.HDR),
gcmap = ld_int(EnvKey.GCMAP)
),
SunshineClientOptions(
host_audio = ld_bool(EnvKey.HOST_AUDIO),
enable_sops = ld_bool(EnvKey.ENABLE_SOPS),
audio_config = SunshineAudioConfig(ld_str(EnvKey.AUDIO_CONFIG))
)
)