@@ -18,6 +18,11 @@ class MissingType:
1818Missing = MissingType () # single value used to check if its missing
1919
2020
21+ @dataclass
22+ class Capabilities :
23+ change_ssid : bool = False
24+
25+
2126@dataclass
2227class ComposeData :
2328 """useful information read from compose.yaml"""
@@ -60,6 +65,13 @@ def get_from_compose() -> ComposeData:
6065 return ComposeData (tld = tld , domain = domain , kiwix_prefix = kiwix_prefix )
6166
6267
68+ def get_capabilities_from_config () -> Capabilities :
69+ yaml_config = read_offspot_conf ()
70+ cap = yaml_config .get ("capabilities" , {})
71+ # only SSID change ATM
72+ return Capabilities (change_ssid = cap .get ("change_ssid" ))
73+
74+
6375def get_wifi_conf_from_offspot_yaml () -> WifiConf :
6476 """read offspot.yaml for updated-not-applied changes to WiFi conf"""
6577 conf = WifiConf ()
@@ -104,6 +116,9 @@ def prepare_context():
104116 # read tld, domain, prefixes from compose
105117 compose_data = get_from_compose ()
106118
119+ # read capabilities
120+ capabilities = get_capabilities_from_config ()
121+
107122 # read wifi conf from offspot.yaml if present
108123 wifi_conf = get_wifi_conf_from_offspot_yaml ()
109124 if not wifi_conf .is_complete :
@@ -120,6 +135,7 @@ def prepare_context():
120135 tld = compose_data .tld ,
121136 domain = compose_data .domain ,
122137 kiwix_prefix = compose_data .kiwix_prefix ,
138+ can_change_ssid = capabilities .change_ssid ,
123139 wifi_profile = wifi_conf .profile ,
124140 wifi_ssid = wifi_conf .ssid ,
125141 wifi_passphrase = wifi_conf .passphrase ,
0 commit comments