diff --git a/python_payload/st3m/application.py b/python_payload/st3m/application.py index 7e47b68f24fa8407a07ae1a5420a997172fefcba..e80e1de6c9f3d0ddb4e880ebbe2445b61c0cc1a4 100644 --- a/python_payload/st3m/application.py +++ b/python_payload/st3m/application.py @@ -8,6 +8,7 @@ from st3m.input import InputState import st3m.wifi from st3m.goose import Optional, List, Dict from st3m.logging import Log +from st3m import settings from ctx import Context import toml @@ -47,7 +48,7 @@ class ApplicationContext: class Application(BaseView): def __init__(self, app_ctx: ApplicationContext) -> None: self._app_ctx = app_ctx - if app_ctx and app_ctx.bundle_metadata: + if app_ctx and app_ctx.bundle_metadata and settings.onoff_wifi_preference.value: self._wifi_preference = app_ctx.bundle_metadata["app"].get( "wifi_preference" ) diff --git a/python_payload/st3m/settings.py b/python_payload/st3m/settings.py index e140526910c9da2e25a29e5b92ac0e78737ef8d7..e5221e15809c3adc1f9b7935fecdfe3116a42f51 100644 --- a/python_payload/st3m/settings.py +++ b/python_payload/st3m/settings.py @@ -384,6 +384,9 @@ onoff_debug = OnOffTunable("Debug Overlay", "system.debug", False) onoff_debug_touch = OnOffTunable("Touch Overlay", "system.debug_touch", False) onoff_show_tray = OnOffTunable("Show Icons", "system.show_icons", True) onoff_wifi = OnOffTunable("Enable WiFi on Boot", "system.wifi.enabled", False) +onoff_wifi_preference = OnOffTunable( + "Let apps change WiFi", "system.wifi.allow_apps_to_change_wifi", True +) str_wifi_ssid = StringTunable("WiFi SSID", "system.wifi.ssid", "Camp2023-open") str_wifi_psk = ObfuscatedStringTunable("WiFi Password", "system.wifi.psk", None) str_hostname = StringTunable("Hostname", "system.hostname", "flow3r") @@ -395,6 +398,7 @@ load_save_settings: List[UnaryTunable] = [ onoff_debug, onoff_debug_touch, onoff_wifi, + onoff_wifi_preference, str_wifi_ssid, str_wifi_psk, str_hostname, @@ -411,6 +415,7 @@ settings_menu_structure: "MenuStructure" = [ onoff_debug, onoff_debug_touch, onoff_wifi, + onoff_wifi_preference, MenuItemAppLaunch(BundleMetadata("/flash/sys/apps/w1f1")), ]